guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: rfc: script exit value from ENTRY-POINT retval


From: Neil Jerram
Subject: Re: rfc: script exit value from ENTRY-POINT retval
Date: Sat, 24 Jul 2010 22:53:45 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux)

Thien-Thi Nguyen <address@hidden> 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 via email to

[Prev in Thread] Current Thread [Next in Thread]