rust_lisp
rust_lisp copied to clipboard
Stackoverflow not caught by the interpreter
A stack overflow is not caught by the interpreter => boom crash panic Example:
; + operator just so no tailcall optimization will help out
(defun overflow () (+ 1 (overflow)))
(overflow)
Optimally, the interpreter will return an error. You could add a depth value to the Env struct. If you try to enter a new env, and the new depth exceeds a maximum stack height, it will return an error