guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: "Missing" libraries/concepts found in other languages/ecosystems?


From: Chris Vine
Subject: Re: "Missing" libraries/concepts found in other languages/ecosystems?
Date: Sat, 11 Jul 2020 11:14:00 +0100

On Sat, 11 Jul 2020 02:34:22 +0200
Zelphir Kaltstahl <zelphirkaltstahl@posteo.de> wrote:
> The comments about exception handling also reminded me of the following
> blog post:
> 
> https://blog.sulami.xyz/posts/common-lisp-restarts/
> 
> Pretty cool concept as well.
> 
> If there anything like it in Guile or is something like it possible
> (probably, right?)?

I think common lisp restarts are by and large useless.  They rely on
the assumption that the caller of a procedure which throws knows better
how to handle an exception arising in that procedure than the procedure
itself.  That is rarely the case.  Usually the code at the site of the
error should do what it can to remedy the problem and then (if it cannot
be fully rectified) throw an exception which unwinds the stack, for the
exception to be picked up elsewhere.

That is how most exception systems work.  Scheme's continuable
exceptions are analogous to restarts (albeit only having the exception
site as their destination) and suffer from the same problem in my
view.  The only place I have seen restarts used in action are in
building REPLs.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]