;;;; A dyn arithmetic trap says where it happened. ;;;; ;;;; In a dynamic-first language the dyn traps ARE the type errors, and until ;;;; the diagnostics pass they printed with no file, no line and no column: ;;;; ;;;; dyn +: int and text, and it takes two numbers — (+ 3 "hi") ;;;; ;;;; flan_rt.c's bounds and arithmetic traps have taken an emitter-threaded ;;;; (loc, loclen) pair since they were written, so the ABI precedent was ;;;; already there; the five arithmetic and four ordering entry points in ;;;; flan_dyn.c simply were never given one. They take it now, and the trap ;;;; prints it as the GNU "file:line:col: " prefix, which is what makes ;;;; next-error walk to a dyn failure the way it walks to a bounds failure. ;;;; ;;;; This program exists for the prefix and for nothing else. The line prints ;;;; first so that the test can tell "the program ran and then trapped" from ;;;; "the program did not start", and the operation is inside a defn so that ;;;; the site reported is the operator's own and not the call's — which is the ;;;; distinction that matters: the + is what failed, and the + is what the ;;;; caret should be under. (defn add [x y] dyn (+ x y)) (defn main [] () (print "before\n") (print (add 3 "hi")) (print "unreachable\n"))