unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Neil Jerram <neil@ossau.uklinux.net>
To: Thien-Thi Nguyen <ttn@gnuvola.org>
Cc: guile-devel@gnu.org
Subject: Re: rfc: script exit value from ENTRY-POINT retval
Date: Sat, 24 Jul 2010 22:53:45 +0100	[thread overview]
Message-ID: <87aapgeec6.fsf@ossau.uklinux.net> (raw)
In-Reply-To: <87wrsn28nz.fsf@ambire.localdomain> (Thien-Thi Nguyen's message of "Thu, 22 Jul 2010 11:00:16 +0200")

Thien-Thi Nguyen <ttn@gnuvola.org> writes:

> In Guile 1.4.x, i just installed this:
>
>   * for scripts with -e ENTRY-POINT, exit value is ENTRY-POINT retval
>   
>   Previously, ENTRY-POINT retval was ignored; scripts would always exit
>   successfully (exit value of zero) unless ‘exit’ was called explicitly.
>
>   This change is backward compatible if you explicitly call ‘exit’;
>   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 ‘main’ and Scheme ENTRY-POINT, making ENTRY-POINT easier to
>   use internally, generally (caller no longer needs to catch ‘quit’).

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



      reply	other threads:[~2010-07-24 21:53 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-22  9:00 rfc: script exit value from ENTRY-POINT retval Thien-Thi Nguyen
2010-07-24 21:53 ` Neil Jerram [this message]

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=87aapgeec6.fsf@ossau.uklinux.net \
    --to=neil@ossau.uklinux.net \
    --cc=guile-devel@gnu.org \
    --cc=ttn@gnuvola.org \
    /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).