develooper Front page | perl.perl5.porters | Postings from September 2011

Re: [perl #100364] exit doesn't match its documentation

Thread Previous | Thread Next
From:
David Golden
Date:
September 29, 2011 17:49
Subject:
Re: [perl #100364] exit doesn't match its documentation
Message ID:
CAOeq1c9Bvee_RajqRV-rMogYdDr_ua3KEmO4BHx=GhKGWQ9Qig@mail.gmail.com
On Thu, Sep 29, 2011 at 7:25 PM, Abigail <abigail@abigail.be> wrote:
>> Possibly, EXPR should be replaced throughout with terms that are
>> descriptive of use.  E.g. "exit VALUE".  This would be consistent with
>> the use of "FILEHANDLE", "DIRHANDLE", "VARIABLE", "REF", "BLOCK", etc.
>
> Is '1 == 0' a value? If so, it doesn't solve the ambiguity of 'exit 1 == 0'.
> But if '1 == 0' isn't a value, it doesn't explain why 'exit(1 == 0)' is valid.

I said 'VALUE' because that is what is in the text:

    Evaluates EXPR and exits immediately with that value.

(This is extra confusing because the word "evaluates" implies that
EXPR could be more than a scalar value -- which it can be, but only if
you parenthesize it to avoid operator precedence issues)

One could say 'exit EXITCODE' or something, I suppose.

Short of rewriting perlfunc to use 'exit(EXPR)' or having an explicit
statement of how things are prototyped, I don't see any easy answers
to make documentation clearer.  How about this ultra redundant form:

    exit EXITCODE
    exit( EXPR )

-- David

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About