From: Andy Wingo <wingo@pobox.com>
To: Ian Price <ianprice90@googlemail.com>
Cc: bug-guile@gnu.org, guile-devel <guile-devel@gnu.org>
Subject: Re: exit & dynamic wind
Date: Thu, 24 Mar 2011 20:23:04 +0100 [thread overview]
Message-ID: <m3k4fos4pz.fsf@unquote.localdomain> (raw)
In-Reply-To: <AANLkTinpbbxnpr2ik3W3He3i=7js7mYTeSNeOLiAs7_4@mail.gmail.com> (Ian Price's message of "Tue, 22 Mar 2011 13:26:55 +0000")
On Tue 22 Mar 2011 14:26, Ian Price <ianprice90@googlemail.com> writes:
> If you run (exit) at the repl, it is caught, and any after-thunks from
> dynamic-wind will be called when you continue with ,q . However, in a
> guile script, it is not an error, and the after-thunks are not
> called.
I have tracked this down and it seems that this was the case in 1.8 as
well.
The issue is that when you run a script, the default catch-all ends up
being provided by scm_c_with_continuation_barrier. This procedure uses
scm_handle_by_message_noexit as the pre-unwind handler, and that
procedure in turn does an `exit' if the key is `quit'.
However this sounds bogus to me: usually you would want to unwind.
Furthermore you probably want to print the message using the ports that
were current at the time of the with-continuation-barrier, not the
throw.
This change first appeared in 43e01b1ee350c823505d1397a306c8e1bfa31469,
in 2006, and appears to be a misunderstanding.
I have pushed something that causes the stack to be unwound before
exiting. Please let me know if you still see problems.
Thanks,
Andy
--
http://wingolog.org/
next prev parent reply other threads:[~2011-03-24 19:23 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-22 13:26 exit & dynamic wind Ian Price
2011-03-24 19:23 ` Andy Wingo [this message]
2011-03-25 1:52 ` Neil Jerram
2011-03-25 16:45 ` Andy Wingo
2011-03-30 10:45 ` Andy Wingo
2011-03-30 18:31 ` Neil Jerram
2011-03-30 21:25 ` Andy Wingo
2011-03-30 21:43 ` Andy Wingo
2011-03-30 21:54 ` Neil Jerram
-- strict thread matches above, loose matches on Subject: below --
2011-03-30 19:06 Mike Gran
2011-03-30 21:28 ` Andy Wingo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m3k4fos4pz.fsf@unquote.localdomain \
--to=wingo@pobox.com \
--cc=bug-guile@gnu.org \
--cc=guile-devel@gnu.org \
--cc=ianprice90@googlemail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).