Hacker News new | ask | show | jobs
by masklinn 570 days ago
That is literally what Common Lisp has and GP describes…

https://en.m.wikibooks.org/wiki/Common_Lisp/Advanced_topics/...

2 comments

It is always fun when people learn some of the things that common lisp has done for a long time.
I realize you could probably build this in lisp, but this (by default) seems to be missing the part about jumping back to where the exception was raised, instead of resuming flow control from where the restart was defined, iiuc.
There is nothing to build, restarts act on the location where the condition was raised. In a conditions system unwinding is a restart, conditions don't unwind before running handlers.

The ability to update a value would make no sense otherwise.

I repeat, what you describe is literally how common-lisp works. Today. And how it has worked for 40 odd years. Also smalltalk.