From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andy Wingo Newsgroups: gmane.lisp.guile.devel,gmane.lisp.guile.bugs Subject: Re: exit & dynamic wind Date: Thu, 24 Mar 2011 20:23:04 +0100 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1300994587 18782 80.91.229.12 (24 Mar 2011 19:23:07 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 24 Mar 2011 19:23:07 +0000 (UTC) Cc: bug-guile@gnu.org, guile-devel To: Ian Price Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Thu Mar 24 20:23:01 2011 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Q2q7Z-0001DO-LZ for guile-devel@m.gmane.org; Thu, 24 Mar 2011 20:23:01 +0100 Original-Received: from localhost ([127.0.0.1]:36543 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q2q7Y-0003gr-Ti for guile-devel@m.gmane.org; Thu, 24 Mar 2011 15:23:01 -0400 Original-Received: from [140.186.70.92] (port=55200 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q2q7U-0003g1-Ju for guile-devel@gnu.org; Thu, 24 Mar 2011 15:22:57 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q2q7T-0004t7-H3 for guile-devel@gnu.org; Thu, 24 Mar 2011 15:22:56 -0400 Original-Received: from a-pb-sasl-sd.pobox.com ([64.74.157.62]:51415 helo=sasl.smtp.pobox.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q2q7R-0004sS-9p; Thu, 24 Mar 2011 15:22:53 -0400 Original-Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTP id B4FDA4EA6; Thu, 24 Mar 2011 15:24:33 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=sasl; bh=GDrcWeF6fbrLfii/OJVEM47hY/Y=; b=mT0/WU KBVv6zQZb9j2TaPruYzFg9BjrwNoErfrvQ9S2C746o29NBgLALTMjwLmej3T++5Q hj4NwvnNKLEcvZeHsdRVduCrJLYQXQMqAdrr47v207/M8X9aDlWs1JHPEjJN54wJ P1h3sG1plqJDxd0r90/BbOcDT+phjjkY0Q40Q= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; q=dns; s=sasl; b=M2PoBggSxMkwUIilmRa6VUZdx7zrETUm 3awwLgVroF5EacrjW8QkB8lIPls73qqIGR2eg8jpW1XokoMQc24HF/Kp/MwJD/TT 7XU9eCgiYk+J9PzrpqIViPydlIJIYtnWoFdzOs61JIIh21A95vU0EFFaaOsvVn+Y IzOE+xW1q9U= Original-Received: from a-pb-sasl-sd.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTP id 93FD94EA5; Thu, 24 Mar 2011 15:24:31 -0400 (EDT) Original-Received: from unquote.localdomain (unknown [90.164.198.39]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTPSA id 91DCE4EA4; Thu, 24 Mar 2011 15:24:28 -0400 (EDT) In-Reply-To: (Ian Price's message of "Tue, 22 Mar 2011 13:26:55 +0000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) X-Pobox-Relay-ID: 57F8657A-564C-11E0-A849-E8AB60295C12-02397024!a-pb-sasl-sd.pobox.com X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta) X-Received-From: 64.74.157.62 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:11968 gmane.lisp.guile.bugs:5362 Archived-At: On Tue 22 Mar 2011 14:26, Ian Price 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/