Clojure provides a mechanism for early termination from reduce expressions with 'reduced': https://clojuredocs.org/clojure.core/reduced
It's unusual to see a special early termination function: most PLs only provide general control flow constructs like exceptions.
miniblog.
Related Posts
Every time I implement an interpreter with recursion, I regret it.
As soon as I want TCO, or userland control of stack limits, or resumable exceptions, I need my own stack.
This is awkward because it's an upfront design decision. Changing the stack model is a big refactoring.
Switching between Rust and TypeScript, I really miss the Result type in TypeScript. I can kludge something with nullable types or exceptions, but it's not as nice for the caller.
Python is adding column numbers to its exceptions, making tracebacks way more readable!

