I am posting this as an individual member of the Scheme
community. I am not speaking for the R6RS editors.
John Cowan <cowan_at_ccil.org> writes:
> Marcin 'Qrczak' Kowalczyk scripsit:
>
>> I would prefer to have a standard condition which is intended to exit
>> the program, and which carries the exit code. A standard function with
>> an optional exit code parameter just raises that condition.
>
> This would also have the advantage that Plan 9, whose exit code is a
> string, could be accommodated. Posix and Windows won't rule forever.
This makes sense to me. Here's a suggestion on how it might work:
A new condition type
(define-condition-type &exit-code &condition
exit-code-condition?
(exit-code condition-exit-code))
would be introduced. The spec would say something like:
If the final expression in a script returns, the script is assumed to
have run successfully, and the return value is ignored. When the
default exception handler of the script is invoked, the script is
assumed to have run unsuccessfully. The condition object provided
with the exception may be used to report a status to the operating
system. Specifically, a &message condition may specify a string to be
used as a status on operating systems where this makes sense, and and
&exit-code condition may specify an exact integer to be used on
operating systems where this makes sense.
I'm not familiar with Plan 9. Would this seem acceptable to you?
--
Cheers =8-} Mike
Friede, V?lkerverst?ndigung und ?berhaupt blabla
Received on Thu Oct 05 2006 - 05:37:42 UTC