You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Runtime errors name their function in the message, not in a field #1663
A runtime error a program catches names the function in its message text and carries no position. #1662 moves compile errors to fields; this issue holds the runtime half.
What a caller gets today:
About 574 primitive messages start with the function's name, such as "/: division by zero" from src/arithmetic.rs. The message then reads differently for each function that raises the same error.
A runtime error carries no :function, :file, :line or :col. The VM records error_loc and a stack trace, and writes both into text only (VM::format_error_with_location).
The eval instruction (src/vm/eval.rs) turns a runtime error inside the evaluated code into {:error :eval-error :message …}, whose message holds the stack trace, the location and Runtime error:. Its other refusals start with eval:.
The target shape:
{:error :division-by-zero:message"division by zero":function'/ :file"math.lisp":line16:col 0}
What would close it:
The VM adds :function, :file, :line and :col to an error a primitive raises, from the call it is running.
No primitive message carries its function's name.
eval raises the evaluated code's runtime error as that error, not as an :eval-error with text.
A test catches a runtime error from a primitive and reads the function and the position from the fields.
Activity