Skip to content

Blocks give their last expression; if as expression - #84

Merged
kryptamine merged 1 commit into
masterfrom
block-tail-values
Nov 16, 2026
Merged

kryptamine merged 1 commit into
masterfrom
block-tail-values

Conversation

@kryptamine

Copy link
Copy Markdown
Owner
  • A block's last expression without ; is its value: fun/method/arrow bodies, if branches, match arm blocks. A trailing if/match with values is the value too.
  • if is an expression; without else it gives nil.
  • while/for/defer/try bodies have no value: a missing ; is an error.
  • Removed c ? a : b and fun f() => e; (one way). Arrows x => e stay.
  • x => { x } is now a block returning x.
  • Tests, examples, docs migrated.

@kryptamine
kryptamine merged commit d78f9ec into master Nov 16, 2026
3 checks passed
@kryptamine
kryptamine deleted the block-tail-values branch November 16, 2026 15:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant