Re: [S29] Mutating map and grep

2005-08-01 Thread Ingo Blechschmidt
Hi, "TSa (Thomas Sandlaß)" wrote: > Ingo Blechschmidt wrote: >> Is this a bug in S29 or will this be feature removed from Perl 6 >> and you'll have to say (for example) >> >> use listops :mutating; >> my @result = map { $_++; 42 } @array; # works now > > Why not just > > my @result =

Re: [S29] Mutating map and grep

2005-08-01 Thread TSa (Thomas Sandlaß)
HaloO, Ingo Blechschmidt wrote: Is this a bug in S29 or will this be feature removed from Perl 6 and you'll have to say (for example) use listops :mutating; my @result = map { $_++; 42 } @array; # works now Why not just my @result = map -> $_ is rw { $_++; 42 } @array; # works

[S29] Mutating map and grep

2005-08-01 Thread Ingo Blechschmidt
Hi, according to S29 [1], neither map nor grep allow mutation: multi sub Perl6::Array::map (@values, Code $expression) returns Lazy multi sub Perl6::List::map (Code $expression : [EMAIL PROTECTED]) returns Lazy multi sub Perl6::Array::grep (@values : Code *&test ) returns