Pitch: Multi-statement if/switch/do expressions

I think these two discussions (about if/do/switch expressions and using a “return”/“result” value after the actual statement) are orthogonal and the latter doesn’t really belong in this thread - for instance, there’s some discussion in another evolution post on function body macros about enabling defer to access a return value, which could neatly solve this issue for both the expressions being considered here as well as normal function calls and other applications like macros.

No matter the outcome of this review, I think accessing a “return” value after its actual control-flow statement is a completely separate pitch to handle all the places in the language it might touch, so let’s not derail this thread further.

2 Likes