[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: New(?) idea for making backtraces usable: condition-case*
From: |
Richard Stallman |
Subject: |
Re: New(?) idea for making backtraces usable: condition-case* |
Date: |
Tue, 18 Jul 2023 22:19:46 -0400 |
[[[ To any NSA and FBI agents reading my email: please consider ]]]
[[[ whether defending the US Constitution against all enemies, ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]
> My idea here is to write a new special form, condition-case*. This would
> behave the same as condition-case unless a signal is signalled. In that
> case the error handler forms would evaluate _before_ the specpdl gets
> unwound. This unwinding would take place on exiting an error handler in
> the form. The unwinding would NOT happen if the error handler is exited
> with, say, signal. This would give nested condition-case*'s the chance
> to output a full backtrace.
> In the event of generating a backtrace, the entire stack at the point of
> failure would get output.
> Possibly, a new function unwind-stack might be needed, so that an error
> handler can unwind the stack explicitly. I haven't thought this through,
> yet.
This is a lot of complexity and risk of problems. I think that stems
from trying to do the work in Lisp and make it super-flexible.
I conclude that that is not the right approach for this. We need
ways to save some information when an error happens, but we don't
need to make it totally flexible, and doing so could make it
much harder to write, and less convenient to use anyway.
And it should not be limited to the scope of one construct.
If variables control it, any way of binding the variable will
do the job.
A feature to do _enough and no more_, implemented mostly in C, would
be simpler and avoid raising problematical corner cases.
--
Dr Richard Stallman (https://stallman.org)
Chief GNUisance of the GNU Project (https://gnu.org)
Founder, Free Software Foundation (https://fsf.org)
Internet Hall-of-Famer (https://internethalloffame.org)
Re: New(?) idea for making backtraces usable: condition-case*,
Richard Stallman <=