4 ms·
"continuations" are not in standard Common Lisp. They are a Scheme feature (-> functions which capture a state of computation). Common Lisp has a standardized e
by lispm 2y ago
"continuations" are not in standard Common Lisp. They are a Scheme feature (-> functions which capture a state of computation). Common Lisp has a standardized exception handling system called the "Condition system", it features conditions (-> exception classes), handlers and restarts. It provides a non-terminating exception handling system, also often with a user interface -> the user can choose a restarts via some menu system or in the REPL. Something similar is in Smalltalk, which provides excellent tools for error handling and debugging.
Lisps prior to Common Lisp usually had elaborate ways to handle runtime errors and extensive REPL interfaces for it, for example the break loop -> a REPL in the error context. The most prominent and widely cited was the one of Interlisp, which featured also user facing automatic error repair (-> DWIM).
Whenever I see a Lisp, which doesn't stop at an error and then let me look at it, I feel sad.
GNU Emacs is an application (a text editor) -> debug-on-error is by default NIL. That makes sense in an application.
> that never became a thing everyone wants, I guess it's not as critical as you paint it to be.
People asked for it, it seems. But the answer was no.
See for example "https://vimeo.com/223309989 https://vimeo.com/223309989", "REPL driven development". It was a topic in the Q&A at the end.
Also: Since JVM/Java already has a built-in exception handling, why build another one?
There are some libraries...
- iLemming 2y agoAh... it's that thing that stars a debugger when you hit an exception, right?
- brabel 2y agoCommon Lisp has the Condition System [1] and that is not a continuation mechanism, though it may seem similar because you can stop a computation and resume it with a different value, for example. I think that to classify as a continuation, CL would just need to expose the condition system's internals to allow the user to choose how to "use" it, but as it is, you can't: the only way to use conditions is to have predefined handlers for them... I remember that this was an important difference because with delimited continuations you can implement stuff (like async/await I think - probably most Monads?) that you can't in CL's Condition Systems (I can't find the article talking about this right now, hopefully someone else can chip in). [1] https://lisp-docs.github.io/cl-language-reference/chap-9/j-b-condition-system-concepts https://lisp-docs.github.io/cl-language-reference/chap-9/j-b...
- iLemming 2y agoWhoa, thank you. You made me look up for 'condition system in Clojure' and I found these: https://andreyor.st/posts/2021-04-17-condition-system-in-clojure/#:~:text=So%2C%20the%20condition%20system%20consists,condition%20system%20to%20signal%20errors%2e https://andreyor.st/posts/2021-04-17-condition-system-in-clo... https://www.reddit.com/r/Clojure/comments/mocs6d/common_lisp_style_conditionsrestarts_in_clojure/ https://www.reddit.com/r/Clojure/comments/mocs6d/common_lisp... https://www.youtube.com/watch?v=zp0OEDcAro0 https://www.youtube.com/watch?v=zp0OEDcAro0