guile-devel
[Top][All Lists]
Advanced

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

rfc: script exit value from ENTRY-POINT retval


From: Thien-Thi Nguyen
Subject: rfc: script exit value from ENTRY-POINT retval
Date: Thu, 22 Jul 2010 11:00:16 +0200

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’).

In Guile 1.4.x, all scripts/* programs use ‘HVQC-MAIN’, which does
‘exit’ explicitly.  The other big corpus of scripts i have experience
with is ttn-do, which used to use ‘HVQC-MAIN’, but now (with the intent
of porting to Guile 2) uses a simpler mechanism that generally does NOT
do ‘exit’ explicitly.

What do people think of making this change in Guile 2.x and 1.8.x?
(Included in the change would be an audit/update of bundled scripts.)

thi



reply via email to

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