Post #3028323
2026-06-01 18:24 UTC
@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.
Replies (1)
-
@joe@f.duriansoftware.com 2026-06-01 18:26
@zwarich@hachyderm.io yeah the source compat issues are what the current swift attempts tend to get wound up in. but having a `yield` statement to evaluate an expression feels kinda gross to me as a half-measure. if you don't need to evolve an existing syntactic structure, evaluating the last expression seems like the better way to go to me