4 ms·
> we emulate call/cc in terms of delimited continuations Seems reasonable. > I like the prompt metaphor, myself Me too. I really like Guile's prompts. They a
by matheusmoreira 1y ago
> we emulate call/cc in terms of delimited continuations
Seems reasonable.
> I like the prompt metaphor, myself
Me too. I really like Guile's prompts. They are delimited and structurally similar to my example above, only they're even more powerful since they have tags which lets programmers unwind to specific delimiters!
I'm implementing this stuff in my lisp right now. The prompt primitive pushes a special continuation marker stack frame which also contains a value. The tagged prompts use symbols as the tag, untagged prompts use nil.
> Seems kind of backwards to call them resumable exceptions
This is is the analogy that enabled me to finally understand this continuation stuff. Alexis King's keynote shows that they are equivalent:
https://youtu.be/TE48LsgVlIU https://youtu.be/TE48LsgVlIU
Everybody understands exceptions. Delimited continuations are exceptions that not only unwind the stack but also back it up into a callable value.