Labelled break, and the reason one error per compile is the real gap
This commit is contained in:
parent
9e6c655116
commit
380924e553
33
NEXT.md
33
NEXT.md
@ -457,7 +457,38 @@ run one lane at a time; item 4 is disjoint and runs alongside any of them.
|
||||
resolving to whatever reused the slot. Wanted on its own terms for entities referred to across frames, and it is the
|
||||
real gate on classes. Buildable now that the allocator exists.
|
||||
|
||||
7. **Signature generations and stale-caller warnings.** The biggest remaining hole in "you never restart the program" —
|
||||
7. **`break` and `continue`, with loop labels.** Declined once deliberately — see "`break`, and why it was not built"
|
||||
— but a game loop wants it and the author has asked for it. Two things settled in conversation:
|
||||
|
||||
**Labels, Odin-style but in the head position.** A keyword names a loop and `break` takes it:
|
||||
|
||||
```
|
||||
(while :outer (< i n)
|
||||
(while (< j m)
|
||||
(when (hit? i j) (break :outer))))
|
||||
```
|
||||
|
||||
A keyword there is unambiguous because a loop condition is never one. It is **not a goto**: control can only leave
|
||||
a loop it is already inside, which is what keeps it safe and is the same restriction Odin's labelled `break` has.
|
||||
|
||||
The two known blockers stand and must be answered: `check.ml`'s `in_frames` rule refuses `return` inside
|
||||
`handler-bind`/`restart-case` **because `return` always crosses**, while `break` crosses only sometimes — a loop
|
||||
wholly inside a `restart-case` body has a legitimate local break — so that blanket refusal has to become a
|
||||
loop-depth-relative-to-frame-entry rule. And `continue` forces a `Tast.While` signature change to carry a latch,
|
||||
because `check_dotimes` folds the step into the body and a `continue` branching to the header would skip it and
|
||||
hang.
|
||||
|
||||
8. **More than one error per compile.** Raised by the author's workflow: write everything, compile at the end, squash
|
||||
the list. That does not work today — `Loc.Error` is the frontend's **one** exception, so the first error aborts the
|
||||
run and you get them one at a time, which is exactly the loop that workflow exists to avoid.
|
||||
|
||||
The fix is in the checker, not in tooling: collect errors and carry on — finish the function, finish the file,
|
||||
report everything found. **No editor work is needed once that exists.** Flan already prints `file:line:col: message`,
|
||||
which is the GNU format Emacs's `compilation-mode` parses with no configuration, so `M-x compile` gives a clickable
|
||||
list and `next-error` for free. Flycheck and a structured JSON report were both considered and are **not** wanted:
|
||||
the author's workflow is compile-at-the-end, not live linting.
|
||||
|
||||
9. **Signature generations and stale-caller warnings.** The biggest remaining hole in "you never restart the program" —
|
||||
a changed signature is still refused rather than versioned. Last because it is the largest and nothing else waits on
|
||||
it.
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user