Post #3028184
2026-06-01 18:20 UTC
@zwarich@hachyderm.io i was proposing the absolutist "everything should be an expression" pov. lately, we've been inching in that direction though; `if` and `switch` can be used as expressions with single-expression arms now, and there is an ongoing proposal to do the same for `do` blocks as well as `if`/`switch` in full generality
Replies (1)
-
@zwarich@hachyderm.io 2026-06-01 18:24
@joe@f.duriansoftware.com It cracked me up to learn that even Java has `switch` expressions now. I think my current aesthetic preference is for every construct to work as an expression, and to treat blocks as a distinct form of expression that needs to end with a `yield` of a value rather than just implicitly returning the final value. Implicitly returning the last value imposes a lot of syntactic restrictions, especially when you're using the Fortress/Swift approach for reducing the need for semicolons.