[Scheme-reports] Formal Comment: (exit #t) should be the same as (exit) Alan Watson 28 Mar 2012 18:49 UTC

Formal Comment

Submitter's Name:           Alan Watson
Submitter's Email Address:  alan@alan-watson.org
Draft Version of Report:    6
Section of draft R7RS:      6.13.4 System interface

The draft R7RS follows the R6RS in specifying that (exit) is a
normal exit, specifying that (exit #f) is an abnormal exit, and
leaving the interpretation of arguments other than #f to the
implementation.

I suggest that the R7RS should specify that (exit #t) is identical
to (exit). (Perhaps it would be clearer to state that (exit #t) is
a normal exit and (exit) is identical to (exit #t)).

This allows the exit status to be handled more uniformly by code
which might exit normally or abnormally. For example, in a compiler
it is often useful to continue after a syntax error, but in this
case one still wants to indicate an abnormal exit. If (exit #t) is
specified as above, one simply has to keep track of whether an error
has occurred in a boolean variable and then:

  (exit (not error-occurred))

rather than the more cumbersome:

  (if error-occurred
    (exit #f)
    (exit))

_______________________________________________
Scheme-reports mailing list
Scheme-reports@scheme-reports.org
http://lists.scheme-reports.org/cgi-bin/mailman/listinfo/scheme-reports