Comment 2 for bug 176464

Revision history for this message
Derick Eddington (derick-eddington) wrote : Re: [Bug 176464] Re: ikrt_exit should unfix exit status number

I think it should conform to the C standard, the Scheme boolean
semantics, and on UNIXes, the common UNIX ability to use [0, 255]. So
that if the Scheme value supplied to the Scheme (exit <status>) is a:

integer, the unfixed value of the unsigned representation of the int
modulo 256 is the exit status.

#f, C's EXIT_FAILURE is the exit status.

not #f (any other object), C's EXIT_SUCCESS is the exit status.

This way, the cases where a specific exit number is required can be done
with Ikarus, and the Scheme boolean semantics of success and failure are
also available. If left ambiguous, then the meaning of the interaction
of (exit <status>) with the OS or parent process can only be understood
by knowing the low-level behind-the-scenes workings of fix-ed integers
and tagged pointers.

Chez, MzScheme, and Larceny have unambiguous exit statuses.

I like Chez's use of a parameter exit-handler which works with cafes,
but I also like the idea of the top cafe's default exit-handler using
Scheme boolean semantics with the two standard C EXIT_ statuses.