Subject: RE: exception from inside false-if-exception?

From: Attila Lendvai <[email-masked]>
Date: Mon, 17 Jun 2024 19:57:58 +0000

apparently this has been fixed between 3.0.9 and HEAD. i've wasted my time chasing a ghost...

can we please have a new release? :)

as a sidenote, i also had some broken expectations in my test.scm.

it's a tangential, but namely, when #:unwind #t then the handler in a w-e-h returns from the w-e-h block, but with #:unwind #f it tries to return to the RAISE that raised the condition. i.e. a lousy little keyword arg (usually a page down) fundamentally changes the behavior of w-e-h. yet another surprise that violated my expectations regarding APIs.

anyway, i've attached a patch that clarifies what's happening for anyone who stumbles upon this; i.e. be clearer that (?) a backtrace is printed due to reaching a continuation barrier.

this makes it grep'able, and if the user also prints a backtrace, then it makes it clear that it's something printed by guile.

if someone wants to investigate further, then i'm also attaching a new version of my test.scm that behaves in an unexpected way on 3.0.9, but not on HEAD (more specifically on guile-next in guix, which is a rather recent commit).

HTH,

-- 
• attila lendvai
• PGP: 963F 5D5F 45C7 DFCD 0A39
--
All men dream, but not equally. Those who dream by night in the dusty recesses of their minds wake in the day to find that it was vanity. But the dreamers of the day are dangerous men, for they may act their dream with open eyes to make it possible.
From d45817097181d4a5812405474ac7b24af3531f7a Mon Sep 17 00:00:00 2001
From: Attila Lendvai <[email-masked]>
Date: Mon, 17 Jun 2024 19:46:45 +0200
Subject: [PATCH] More specific error message for exceptions at continuation
 barriers

---
 libguile/continuations.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libguile/continuations.c b/libguile/continuations.c
index b8b6e1dca..49f8266dd 100644
--- a/libguile/continuations.c
+++ b/libguile/continuations.c
@@ -405,7 +405,7 @@ print_exception_and_backtrace (SCM port, SCM tag, SCM args)
 
   if (should_print_backtrace (tag, stack))
     {
-      scm_puts ("Backtrace:\n", port);
+      scm_puts ("An exception has reached a continuation barrier:\n", port);
       scm_display_backtrace_with_highlights (stack, port,
                                              SCM_BOOL_F, SCM_BOOL_F,
                                              SCM_EOL);
-- 
2.45.1