StÃphane Payrard writes:
> >     canon( subjet => $mysub, complement => $mycomp );
> >     canon( :subjet($mysub) :complement($mycomp) );
> 
> I suppose you meant
> 
>      canon( :subjet($mysub), :complement($mycomp) );

The comma is optional between those kinds of pairs.

> btw, are the parentheses mandatory in the alternative pair syntax? If
> the value is simple to write, I would like to drop the parentheses:
> 
>   canon :subjet $mysub, :complement $mycomp;
> 
> This would happen if a key with colon bind very tightly.  

Yeah, because a plain old :subjet means the same thing as :subjet(1).
Because of that, if we allow omission of the parentheses, we get
term/operator duality.  And we don't have quantum computers yet. %-)

If you don't want to write parentheses, why don't you just use the other
pair notation:

    canon subjet => $mysub, complement => $mycomp;

> I love Perl6 syntax.  Larry, you should post more sample code so that
> people get familiar with that syntax. It is easier to learn by example
> than by reading manuals.  I loved Perl4 syntax but it got ugly with
> the introduction of references in Perl5.  It is about time that Perl
> stops getting a bad rap about being write-only.

Well, it'll still get that bad rap because it's as syntactically
flexible as ever (moreso even), so people have all the freedom they want
to write code ugly as sin.

Anyway, if you want to see more Perl 6 syntax, why don't you post some
"how do I"s to the list, and I'll reply with code.

Luke

Reply via email to