effekt-lang / effekt-lang/effekt
Change semantics of `return` to be an early return
Open
feature
- Dominant language
- Scala
- Stars
- 469
- Forks
- 41
- Avg merge
- 1d 16h
- Merged PRs (30d)
- 23
Description
Right now `return` is a keyword but only used to embed expressions into statements. This is fine for a core representation like System C, but not appropriate for source.
That is, right now
```
def foo() = {
val x = if (true) return 42 else 0;
x + 1
}
```
currently returns `43` and not `42` (which might be confusing to people).
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.