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

Re: SRFI 22 release candidate #3



>>>>> "Marc" == Marc Feeley <feeley@xxxxxxxxxxxxxxxx> writes:

Marc> Anyway, my original point was that I disliked having "main" return an
Marc> integer status code and having a bare 0 at the end of main's body
Marc> (which will confuse the beginner).

... and I still don't understand why it should confuse the beginner.
Surely, to write Unix scripts, one of two cases applies:

#1 You are a beginner in the sense that you don't care about the exit
   code.

#2 You are not a beginner in the sense that you do care about the exit
   code.

If #1 applies, you simply forget about the 0 at the end and you're
fine.  If #2 applies, I can't see how the current way of doing things
would be confusing.

Moreover, not every script that exits needs an EXIT procedure.
Arguably, this tends to obfuscate programs as much as it clarifies
them.

Marc> I would much prefer if the result of main was ignored and EX_OK
Marc> was returned in that case (this was the prime reason why I
Marc> suggested adding "exit", the exit procedure is of secondary
Marc> importance).  So I don't mind if exit is defined in another
Marc> SRFI, I just don't want main's body to end with "0".

So consider EXIT left out SRFI 22 for a second, and let the script
return 0 if MAIN returns at all, no matter the exit value.  How would
you signal failure to the outside world?

-- 
Cheers =8-} Mike
Friede, Völkerverständigung und überhaupt blabla