convex
convex copied to clipboard
Improve error: `recur` without recursion point
Currently produces this error which is not very informative:
(recur 42)
;; ERROR (RECUR)
;; Recur:
Should be something like: 'recur' occurred outside a loop or function body.
Arguably we should be able to detect this as a compile error, though that would probably need some additional compiler context.
I am always advocating for failing fast (ie. at compilation if possible). However this one should not happen very often, probably not much outside of learning or messing around in the sandbox. A better error message should suffice, at least for now.