From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ian Price Newsgroups: gmane.lisp.guile.bugs Subject: exit & dynamic wind Date: Tue, 22 Mar 2011 13:26:55 +0000 Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: dough.gmane.org 1300801521 8996 80.91.229.12 (22 Mar 2011 13:45:21 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 22 Mar 2011 13:45:21 +0000 (UTC) To: bug-guile@gnu.org Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Tue Mar 22 14:45:14 2011 Return-path: Envelope-to: guile-bugs@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 1Q21tX-0004y7-HH for guile-bugs@m.gmane.org; Tue, 22 Mar 2011 14:45:11 +0100 Original-Received: from localhost ([127.0.0.1]:52350 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q21tV-0007yR-Q1 for guile-bugs@m.gmane.org; Tue, 22 Mar 2011 09:45:09 -0400 Original-Received: from [140.186.70.92] (port=55782 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q21lL-0002lR-LT for bug-guile@gnu.org; Tue, 22 Mar 2011 09:36:46 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q21bt-0005Oc-4Y for bug-guile@gnu.org; Tue, 22 Mar 2011 09:26:57 -0400 Original-Received: from mail-iy0-f169.google.com ([209.85.210.169]:36333) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q21bt-0005OW-1Z for bug-guile@gnu.org; Tue, 22 Mar 2011 09:26:57 -0400 Original-Received: by iyf13 with SMTP id 13so9624159iyf.0 for ; Tue, 22 Mar 2011 06:26:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:mime-version:date:message-id:subject:from:to :content-type; bh=xhC/vgZ9pTvrqeZjmqDgldCRePZBJdNst0OgOs4kqCc=; b=MkahqFVqX6bKNNEQT/P3eKgeKkOIwA155FQICrCzRUpUWvndHDESxWLdZO1J0ZGZQv j7Z2RF+xxYUIAYp8wULFvziduV5CaCRPFHoyxxrdegWvgx6j8lbIrgivspEN/dfHyUcl WB/OWwD3WOz4mq+FNnpNjoxo0m7i+oHSV9knU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=G2Ug6L4c5VoIxN6GSnkAaSTkdZCRLNGuKx2zbijIEqKIYPvWk5KWH4F4PfYqY1M9Jd 1xx3Nlk5jd7J8yg5GoFLkvZWOSBLNDeusczL6hniEen/dChW2oBbj4nIr0g8JJYgwlxn 99bA/p8phZGmBiXID2GLGNW2UER3AL89yZTi8= Original-Received: by 10.231.111.234 with SMTP id t42mr5473768ibp.106.1300800415358; Tue, 22 Mar 2011 06:26:55 -0700 (PDT) Original-Received: by 10.231.19.73 with HTTP; Tue, 22 Mar 2011 06:26:55 -0700 (PDT) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 209.85.210.169 X-BeenThere: bug-guile@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Errors-To: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.bugs:5357 Archived-At: Hey guilers, 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. $ cat Desktop/dynamic-wind-test.ss #!r6rs (import (rnrs)) (dynamic-wind (lambda () #f) (lambda () (exit 0)) (lambda () (display "Exiting dynamic wind...\n"))) $ ikarus --r6rs-script Desktop/dynamic-wind-test.ss $ mosh Desktop/dynamic-wind-test.ss $ larceny -r6rs -program Desktop/dynamic-wind-test.ss $ guile -s Desktop/dynamic-wind-test.ss $ racket --script Desktop/dynamic-wind-test.ss $ guile GNU Guile 2.0.0.119-95c1c Copyright (C) 1995-2011 Free Software Foundation, Inc. Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show w'. This program is free software, and you are welcome to redistribute it under certain conditions; type `,show c' for details. Enter `,help' for help. scheme@(guile-user)> (dynamic-wind (lambda () #f) (lambda () (exit 0)) (lambda () (display "Exiting dynamic wind...\n"))) :2:13: In procedure #:1:0 ()>: :2:13: Throw to key `quit' with args `(0)'. Entering a new prompt. Type `,bt' for a backtrace or `,q' to continue. scheme@(guile-user) [1]> ,q Exiting dynamic wind... What I think should probably happen, is that the (exit) should not be caught at the repl, but that the after thunks should be called in both cases (but not if you used primitive-exit or similar). As you can see from the transcript, this is not the popular choice among scheme implementers ;). Thanks, Ian