From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Philipp Stephani
Second, unconditionally copying the backtrace would be expensiveAre you sure about that? In languages that are typic= ally far more performance-sensitive (e.g. Java), the backtrace is also copi= ed unconditionally.=C2=A0an= d
would still not allow access to local variables in stack frames or the
value of dynamic variables at the point where the error was signalled
Just because Java or Python do that doesn't make it a great idea.True, but having the fun= ction names and argument values is better than nothing when debugging the c= ause of a signal.=C2=A0
Third, the solution to this problem in Common Lisp is the HANDLER-CASE
macro which is similar to condition-case but the error handlers are
executed without unwinding the stack.=C2=A0 That doesn't require any co= pying
and gives full access to the stack.That s= ounds like an interesting approach that could be made to solve some common = use cases (e.g. test runners or rethrowing signals).