Pitch: Multi-statement if/switch/do expressions

return returning from the "outer" function closure like in Rust, Ruby, Kotlin and Scala

Hmm, this is a really valuable look at how this works in peer languages. I had previously been supportive of using return over then, but seeing how this works in so many other languages makes me reconsider. While we aren't beholden to the design choices of other languages, it seems like important signal -- this probably tells us at least a little on how people will intuitively expect this to work.

So I'm definitely seeing the appeal of using then instead, to avoid the potential confusion and diverging from how this works elsewhere.

18 Likes