Aaron Sherman writes:
> Larry Wall wrote:
> >   leave :from(Loop) :labelÂLINEÂ <== 1,2,3;
> > [...]
> >   leave <== :foo:bar:baz(1) if $leaving;
> 
> I know it's probably just me, but This section seems to suddenly rely on 
> a lot more knowledge of the current state of Perl 6 syntax than I have. 
> Can someone walk me through these two examples?

Sure.

    leave :from(Loop) :labelÂLINEÂ <== 1,2,3;

Is the same as:

    leave('from' => Loop, 'label' => 'LINE', 1, 2, 3);
    #    +$from          +$label            [EMAIL PROTECTED]

The :foo(Bar) syntax is just another way to write 'foo' => Bar.  That
actually goes for any :foo[bar] for any bracketing construct [].  See
Exegesis 7 for the first of the explanations of those.

I haven't seen :foo:bar:baz(x) before, but I'd assume that it's the same
as :foo :bar :baz(x), which means 'foo' => 1, 'bar' => 1, 'baz' => x .

> What's a C<:from(Loop)>, for example, and how is C<:foo:bar:baz(1)> 
> (what looks like a set of properties to me) related to pairing? Wouldn't 
> that be:
> 
> leave <== 'a'=>'x', 'b'=>'y', 'c'=>'z' if $leaving

That would also work.  They're semantically equivalent.

Luke

Reply via email to