From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Neil Jerram Newsgroups: gmane.lisp.guile.devel Subject: Re: rfc: script exit value from ENTRY-POINT retval Date: Sat, 24 Jul 2010 22:53:45 +0100 Message-ID: <87aapgeec6.fsf@ossau.uklinux.net> References: <87wrsn28nz.fsf@ambire.localdomain> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=gb2312 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1280008472 28947 80.91.229.12 (24 Jul 2010 21:54:32 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 24 Jul 2010 21:54:32 +0000 (UTC) Cc: guile-devel@gnu.org To: Thien-Thi Nguyen Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Sat Jul 24 23:54:30 2010 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 1Ocmfu-0004bi-6m for guile-devel@m.gmane.org; Sat, 24 Jul 2010 23:54:30 +0200 Original-Received: from localhost ([127.0.0.1]:41430 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ocmft-0003lk-Gd for guile-devel@m.gmane.org; Sat, 24 Jul 2010 17:54:29 -0400 Original-Received: from [140.186.70.92] (port=47818 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ocmfp-0003lf-D7 for guile-devel@gnu.org; Sat, 24 Jul 2010 17:54:26 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Ocmfo-0003fA-2m for guile-devel@gnu.org; Sat, 24 Jul 2010 17:54:25 -0400 Original-Received: from mail3.uklinux.net ([80.84.72.33]:58571) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Ocmfn-0003bI-Uo for guile-devel@gnu.org; Sat, 24 Jul 2010 17:54:24 -0400 Original-Received: from arudy (unknown [78.149.224.144]) by mail3.uklinux.net (Postfix) with ESMTP id 9D0A61F66B9; Sat, 24 Jul 2010 22:53:46 +0100 (BST) Original-Received: from arudy (unknown [192.168.11.8]) by arudy (Postfix) with ESMTP id 0696238012; Sat, 24 Jul 2010 22:53:45 +0100 (BST) In-Reply-To: <87wrsn28nz.fsf@ambire.localdomain> (Thien-Thi Nguyen's message of "Thu, 22 Jul 2010 11:00:16 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4-2.6 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:10729 Archived-At: Thien-Thi Nguyen writes: > In Guile 1.4.x, i just installed this: > > * for scripts with -e ENTRY-POINT, exit value is ENTRY-POINT retval >=20=20=20 > Previously, ENTRY-POINT retval was ignored; scripts would always exit > successfully (exit value of zero) unless =A1=AEexit=A1=AF was called ex= plicitly. > > This change is backward compatible if you explicitly call =A1=AEexit=A1= =AF; > there is no change in behavior. On the other hand, if ENTRY-POINT > blithely returns #f or a non-zero integer, that value is no longer > masked; the script will now exit failurefully. > > This change removes the small but gratuitous conceptual discrepency > between C =A1=AEmain=A1=AF and Scheme ENTRY-POINT, making ENTRY-POINT e= asier to > use internally, generally (caller no longer needs to catch =A1=AEquit= =A1=AF). FWIW, I don't find this compelling. As I see it, this change increases the complexity of the rules that a script writer has to know, for no apparent benefit. To explain in detail what I mean... The rule before was: the specified exit value if the script called (exit ...), otherwise 0. The proposed new rule is: the specified exit value if the script called (exit ...), otherwise an integer representation of the entry point's return value. The new rule is much more complex, because it requires understanding how every possible Scheme value can be converted to an integer exit value. So, in return for that complexity, there should be some benefit. But I don't see any - because any script that cares can simply add a call to (exit ...). Am I missing something? What in particular motivated this change in Guile 1.4.x? Regards, Neil