Skip to content
Prev 63151 / 63424 Next

An iteration protocol

Clever! If going for non-local returns, probably best for ergonomics to pass in
a closure (see e.g. `callCC()`). If only to avoid accidental jumps while
debugging.

But... do we need more lazy evaluation tricks in the language or fewer? It's
probably more idiomatic to express non-local returns with condition signals
like `stopIteration()`.

There's something to be said for explicit and simple control flow though, via
handling of returned values.
Until you try that in the global env right? Then the risk of collision slightly
increases. Unless you make your closure more unique via `body()`, but then might
as well use a conventional sentinel.

Best,
Lionel

On Tue, Aug 12, 2025 at 1:45?AM Peter Meilstrup
<peter.meilstrup at gmail.com> wrote: