Stéphane Payrard wrote:
# set? I don't think so.
my $a, $b, $c set 1..3 ; # alphabetic like and, or, xor? # and what precedence relative to them?

well, I'm not sure the feature is good, but I have some idea about the sign that could be used for this :-)


we have all sort of verb forms in Perl6 (is, has, does) so the natural choice seems to be:

    my $a, $b, $c are 1..3;

perhaps it could also be made to DWIM for:

    my @colours are $red, $green, $blue;

or, more prosaically, we could coerce the fat pipe operator to work as a slurpy assignment in this case:

    my $a, $b, $c <== 1..3; # hmmm... am I breaking something here?

or we could even just use an hyper-equal:

    my $a, $b, $c »=« 1..3;

if not for low precedence assignment, "are" could still be used as a (low precedence) "plural" type declaration, as in:

    my $spot, $fido, $billy are Dog; # not Dogs, alas

but I'm afraid this wouldn't be terribly useful either.

ok, enough ranting.

cheers,
Aldo



Reply via email to