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

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

Thread Previous | Thread Next
From:
Eric Brine
Date:
September 30, 2011 17:43
Subject:
Re: [perl #100364] exit doesn't match its documentation
Message ID:
CALJW-qGnjO1Lt4F6oj+D1nteKC2=zQmqnv-3egbCdBmHrxwRVA@mail.gmail.com
On Fri, Sep 30, 2011 at 4:42 PM, Zefram <zefram@fysh.org> wrote:

> Eric Brine wrote:
> >I don't see how that helps. <<1,2>> was given as an example of a
> problematic
> >expression and it is neither arithemtic nor a term.
>
> That's precisely how it helps.  "exit 1,2" doesn't match either of the
> forms that I listed, for exactly that reason, and indeed it's not parsed
> with "1,2" as the argument.  "1", however, *is* an arithmetic expression,
> and so in "exit 1,2" the argument to exit is the "1".
>

Sorry if I wasn't clear, but you missed my point. I was saying that your
syntaxes don't allow for C<exit(1,2)>, which is allowed.  C<1,2> is not a
term, which is what you allowed in parens.

Yes, precisely.  The only arithmetic expressions that you can use with
> the "exit ARITHEXPR" form are the ones that don't start with parens.
>

ok, I was wrong there exit 1 + 2  is not what I thought it was.


>  >the syntax simply the following:
> >
> >   exit TERM
> >
> >A TERM is a simple value or an expression in parenthesis.
>
> That's not what "term" means in the Perl grammar.
>

Ya, I thought exit 1 + 2 was ( exit 1 ) +2. That's wrong.



>
> -zefram
>

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