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

Re: @array = $scalar

Thread Previous | Thread Next
From:
Damian Conway
Date:
September 5, 2005 14:33
Subject:
Re: @array = $scalar
Message ID:
431CB9A0.40202@conway.org
Juerd wrote:

> However, in general, chained operators like comma, junction constructors
> and infix zip, don't get an op= variant.
 >
> There's something nice in
> 
>     $foo = 42;
>     $foo |= .bar for @quux;
> 
> as an alternative for
> 
>     $foo = any 42, @quux>>.bar;
> 
> though

I had always assumed (e.g. in the implementation of Q::S and Perl6::Junctions) 
that the junctive operators had an assignment form. Assignment-comma and 
assignment-zip are harder to imagine uses for, but assignment-any, 
assignment-all, etc. are *very* useful for incrementally building up complex 
junctions.

Damian

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