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
The cause is that the eval() builtin, which is implemented in Rust, calls the sc-expand procedure, which is written in Scheme, and sc-expand raises an error. The REPL's error handler invokes an escape continuation.
Now, if (eval) were written in Scheme, invoking that continuation would cause the (eval) stack frame to be discarded. But it's not. So we get this really weird behavior: the Scheme stack is replaced by the continuation, but the Rust stack is unaffected.
The root cause is that the stack has this pattern: Scheme -> Rust -> Scheme. In this case, the innermost Scheme code can call a continuation and get very odd behavior. We have to prohibit recursing into the interpreter.
The text was updated successfully, but these errors were encountered:
jorendorff
changed the title
Rust eval() built-in should not invoke the expander
lisp: Rust eval() built-in should not invoke the expander
Sep 1, 2017
Very weird symptom: if you trigger a syntax error in the repl, then exit the repl, you get an extra error message.
The cause is that the
eval()
builtin, which is implemented in Rust, calls thesc-expand
procedure, which is written in Scheme, andsc-expand
raises an error. The REPL's error handler invokes an escape continuation.Now, if
(eval)
were written in Scheme, invoking that continuation would cause the(eval)
stack frame to be discarded. But it's not. So we get this really weird behavior: the Scheme stack is replaced by the continuation, but the Rust stack is unaffected.The root cause is that the stack has this pattern: Scheme -> Rust -> Scheme. In this case, the innermost Scheme code can call a continuation and get very odd behavior. We have to prohibit recursing into the interpreter.
The text was updated successfully, but these errors were encountered: