develooper Front page | perl.perl6.language | Postings from February 2005

Re: scoping functions as list operators?

Thread Previous | Thread Next
From:
Aldo Calpini
Date:
February 25, 2005 11:04
Subject:
Re: scoping functions as list operators?
Message ID:
421F76A2.6030204@perl.it
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


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