Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Interesting. This looks like an implementation of the abstract computer science notion of continuations (https://en.wikipedia.org/wiki/Continuation); neat to see them used this way.


The Common Lisp condition system is actually just a dynamically-scoped hook system.

Handlers are the actual hooks; conditions are the object that may trigger some of the hooks when they are signaled. Restarts are an addition on top of the hooks that allows for easier non-local transfer of control; they provide little that handlers do not provide unless you count the Lisp debugger - by design, the only way to leave the debugger is by using a restart.

In other words: no continuations here.


Interesting. I'm not sure I understand; what do the dynamically-scoped hooks lack that continuations would give you?


In Common Lisp, you can only transfer control up the stack. With continuations, you get multiple stacks that you can transfer control between.


To be frank, I do not know. I am not a continuation specialist or even an adept, so I cannot say myself; all I can say for sure is that a condition system can be implemented (and is actually implemented in practice) without any continuations, and therefore doesn't require the underlying language to support continuations. (Common Lisp, for example, purposefully doesn't have them in standard - see http://www.nhplace.com/kent/PFAQ/unwind-protect-vs-continuat...)


It's really orthogonal to continuations.

Scheme has them (continuations) explicitly. CL chose not to, I think for performance reasons if I recall correctly.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: