%hash{@array} >>++
would be pretty much the same as
%hash{$_}++ for @array
if I understand correctly. Is that what you are asking? I think >> applies the operation to all of the elements of the array to the left of the >>. The best example of the >> and << things (I don't know what they are called... maybe not operators), would be
@added = @array1 >>+<< @array2;
which is like
## p5 code, I'm not completely fluent in p6 yet...
for ( my $i = 0; i < $#array1; i++ ) {
$added[ $i ] = $array1[ $i ] + $array2[ $i ]
}
-Bryan | [reply] [d/l] [select] |
@old = %hash{@keys} >>++;
but I'm 100% guessing.
ihb
See perltoc if you don't know which perldoc to read!
| [reply] [d/l] [select] |
%hash{ @keys } >>++;
to run, much less
@old = %hash{ @keys } >>++;
So I don't know what the deal is. I'm running Pugs, and I updated it from svn just today, so maybe they just haven't implimented it yet. I'm pretty sure I was there when japhy asked the question on #perl6, so I'm fairly confident the syntax must be right. What I'm trying to say, I guess, is that I just don't know enough to answer your question! (Man, I hate when that happens!)
-Bryan | [reply] [d/l] [select] |