exit
What it is
No chapter describes this one yet. It exists -- the name comes from the interpreter's own table -- but the prose has not been written. That is a gap in the documentation, not in the engine.
Overloads
One call shape — this function is not overloaded.
| Code | Input | Output | Description |
| no input | not documented yet | — |
Examples
No documentation example calls this form yet.
How it works
exit([code]) -- stop the running script immediately, with an optional process exit code (default 0). Works by returning Err like any other builtin failure -- the same ?-propagation every error already uses unwinds through every enclosing loop, function call and block with no new control-flow mechanism needed -- but records the requested code in self.exit_code FIRST, so the top-level caller (qu-cli's cmd_run and friends) can tell "the script asked to stop here" apart from "the script broke" and print neither a runtime error: prefix nor a stray message for the ordinary, successful exit() case. See exit_code's own doc comment on the Interp struct.
From the note above this builtin in the interpreter, where the reasoning was written down as it was built.