Hacker News new | ask | show | jobs
by bandrami 699 days ago
I'm curious how it handles call/cc. I at least think you would have to make your own continuation stack, unless there's some way to get at the internals of unwind-protect that would make doing it natively possible.
1 comments

That's how PAIP does it, their interpreter uses continuation passing style:

22.5 An Interpreter Supporting Call/cc

https://github.com/norvig/paip-lisp/blob/main/docs/chapter22...

23.2 Introducing Call/cc [see the next chapter, 23.3 The Abstract Machine, for the implementation in bytecode]

https://github.com/norvig/paip-lisp/blob/main/docs/chapter23...