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

[Scheme-reports] Formal Comment: (exit #t) should be the same as (exit)



Formal Comment

Submitter's Name:           Alan Watson
Submitter's Email Address:  alan@x
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@x
http://lists.scheme-reports.org/cgi-bin/mailman/listinfo/scheme-reports