Error conditions
Errors fall into two classes: compile-time errors, which prevent a script from loading at all, and run-time errors, which terminate a single execution. Structural problems are caught at compile time; type, name, arity, and resource problems are caught at run time.
Compile-time errors
A compile-time error produces an error message and no runnable script. These reflect problems in the source's lexical form, structure, declarations, or command shapes, as grouped below.
Lexical
- Unterminated
'...'literal string. - Unterminated
"..."interpolated string. ¬ followed by a name.- An unexpected character that begins no token.
Structural / syntactic
- A top-level form that is not
def,const, or a handler. defwithout a following name, or whose value is not a{ … }block.constwithout a name or without a value.- An unknown handler phase or unknown event name.
- A filter on an event that accepts none (
tick,load,idle,combat), or a filter word that is not a recognized command. - A handler body that declares a
<...>parameter list (including<>). - Malformed block parameter list: a non-name inside
<...>, a...rest prefix with no name, a rest parameter that is not last, a duplicate parameter name, or a missing>. - Unbalanced delimiters: missing
},), or]. &on a special-form name (if,each,select, operator builtins, etc.) — these are not first-class values.$not followed by a name.
Declaration / namespace
- A
defwhose name collides with a builtin or a reserved command name. - A duplicate
defname, or a duplicate top-levelconstname. - A
letor nestedconstthat names something already bound in the same scope (a parameter or an earlier local) - A reference to a lexical
$namethat resolves to no binding, or asetof an unbound or immutable name — all caught at compile time.
Command-shape
- An unknown command (a bareword that resolves to no builtin or
def). - Wrong argument count for a builtin (checked against its declared min/max).
- The dedicated shape checks:
if/elif/elsemalformed (missing condition or non-block body, stray tokens afterelse),unlessgiven more than a condition,each/select/every/somewithout an iterable and a block body,randomlywithout a block body or with a non-ormarker,set/let/constwithout a literal name,break/continuegiven arguments,/>with too few steps or a non-command step, etc. - A zero-argument consumer (
if,randomly) given a named-parameter branch block whose declared arity is ≥ 1.
Run-time errors
A run-time error terminates the running execution.
Type errors
Raised when an operation's operand has the wrong type:
- Ordered comparison (
gt,lt,ge,le) on a non-intoperand. store/recallwith a non-string slot name, or an entity argument that is not a creature, object, or room.pausewith a non-intduration.- A boolean context fed a non-
boolvalue (Properties of types and values). - Invoking a value that is not a block in command position.
- Using a non-iterable where an iterable is required — e.g.
each,select,every, orsomeover something that is not a list or iterable.
Type-error messages name the offending argument and the expected and actual type (Types lists the type-name strings).
Name and binding errors
- Reading or invoking a top-level
def/constwhose initializer has not yet run. - Reading a handler-injected name the event does not provide — e.g.
$actorin atickhandler (Variables).
(Undefined $name, set of an unbound or immutable name, and duplicate
let/const in a scope are all compile-time errors, not run-time
ones.)
Arity errors
- Calling a block with fewer arguments than its declared arity (Blocks).
Value errors
- Division or modulo by zero (
/,%). intof a string that does not parse as a base-10 integer.
Stale entity references
Resolving a creature or object reference whose entity has been
destroyed terminates the script (Types). This
termination ends the execution quietly — no error message is produced.
Resource limits
Exceeding any of the execution bounds described in Run-time — the per-execution work budget, recursion depth, or expression-nesting depth — terminates the script with an error.
Error reporting
An execution terminates at the first error; no further errors from the
same execution are possible. Error messages include the source line
when it can be determined. There are no exceptions and
no try/catch; a run-time error always terminates the current
execution.