On Tuesday 04 September 2001 06:39 pm, Damian Conway wrote:
> the "expr" is more likely to be a "parameter_specification".

Urk.  I'll wait for the movie, I think.

>    > >    >  6. [ LABEL: ] expr if expr;
>    > >    >  7. [ LABEL: ] expr unless expr;
>    > >
>    > > I'm not at all sure modifiers will be stackable, as this grammar
>    > > implies.
>    >
>    > Er, parsing error.  Are you saying I've got it right or wrong?  (I'm
>    > intending non-stackable.)
>
> Hmmmm. I had assumed that your grammar implies a statement is an expr.
> But perhaps it didn't.

The simplest statement is an expression.  I'm trying to couch the definition 
of what composes an expression to exclude 'if', 'while', 'for', etc.
Apparently right poorly, at that.

>    > Wouldn't a null statement be covered by a statement of 0 expressions?
>
> Oops. Yes. I missed that. So you just need to s/terminator/separator/

Done.

>    > Would you *please* consider reforming the 'when expr : { block }'
>    > clause as when ( expr ) { block }
>    > ?
>
> That's Larry's syntax. And Larry's decision. For what it's worth, I have
> previously argued against that colon. And you'll note that Switch.pm
> doesn't require it (except in Perl 6 compatibility mode)

Okay... well, Larry, if you're listening in.....

>
>    > Secondly, do 'when' clauses have targettable labels?
>
> They are not 'clauses', they are statements. So yes, a C<when> can
> definitely take a label.
>
>    > given ( $a ) {
>    >         when /a/ : { foo($a); next BAR }
>    >         when /b/ : { ... }
>    >    BAR: when /c/ : { ... }
>    >         ...
>    > }
>
> That would be:
>
>      given ( $a ) {
>              when /a/ : { foo($a); goto BAR }
>              when /b/ : { ... }
>         BAR: when /c/ : { ... }
>              ...
>      }

If they were statements, wouldn't that be:

         when /a/ : { foo($a); goto BAR };
         when /b/ : { ... };
    BAR: when /c/ : { ... };
         ...

That's why I was considering them blocks, which I, of course, mislabelled 
clauses.  Like if blocks and while blocks.

>
> Using C<next BAR> would (presumably) cause control to head up-scope
> to the first *enclosing* block labelled 'BAR'.

But wasn't a bare 'next' supposed to continue on to the next statement?

given ( expr ) {
    when /a/ : { foo; next }
    when /b/ : { bar }
}

If /a/ is true, do foo(), and then continue on to the next statement.
If that was/is still the case, then wouldn't a 'next LABEL' imply continuing 
on to the next statement labelled LABEL?

Of course, if it is no longer 'next', then that's fine, too.  We want things 
to be consistently different.

-- 
Bryan C. Warnock
[EMAIL PROTECTED]

Reply via email to