guile-devel
[Top][All Lists]
Advanced

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

Re: exception from inside false-if-exception?


From: Attila Lendvai
Subject: Re: exception from inside false-if-exception?
Date: Mon, 29 Apr 2024 21:42:19 +0000

> I think I've had similar problems in the past, I did fine this IRC
> conversation:
> 
> https://logs.guix.gnu.org/guile/2021-01-19.log#204926

the very same bug was already discussed in 2021?!

from the log:

> you're using a pre-unwind handler here
> whereas false-if-exception only sets a post-unwind handler
> so yours gets to run first

oh my, what a mess!

do i get this right? (with-exception-handler ... #:unwind? #f) installs a so 
called pre-unwind-handler, which takes priority over a false-if-exception, even 
if deeper in the stack, because f-i-e installs a post-unwind-handler?

if this is the case, then i'll basically need to review all the scheme code i 
wrote in the past two years... :)

i came from common lisp, and from a distance i always had this impression of 
scheme that it is a much more cleaned up lisp... but in CL the condition system 
is way cleaner/simpler than this. i wrote long running, multi-threaded web 
services with advanced logging (backtraces, user installable backtrace 
decorators, etc), error handlers that deal with nested errors, etc... so i'm 
rather familiar with the problem domain, but apparently i'm lost in the forest 
here.

maybe the native call/cc primitive brings in a kind of complexity that is not 
present in CL around exceptions, unwinding, and backtraces.

> All uses of false-if-exception are wrong

i second this sentiment! our CL team had a syntax for IGNORE-ERRORS, its CL 
equivalent, to be colored bright red in emacs. and it doesn't even have the 
pre/post-unwind-hook baggage.

thank you both for the quick feedback!

-- 
• attila lendvai
• PGP: 963F 5D5F 45C7 DFCD 0A39
--
“A society that puts equality — in the sense of equality of outcome — ahead of 
freedom will end up with neither equality nor freedom. The use of force to 
achieve equality will destroy freedom, and the force, introduced for good 
purposes, will end up in the hands of people who use it to promote their own 
interests.”
        — Milton Friedman and Rose Friedman




reply via email to

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