Mark J. Reed wrote:
3. the reduction meta-operator  [...] :   [OP](@list)  collects the
result of applying OP to the elements of the list in order.  That is,
assuming foo() is a binary sub,  [foo](1,2,3,4) =
foo(foo(foo(1,2),3),4).  So [+](@list) generates a sum of the listed
values, [*] generates their product, etc.

Wow... That's a foldl! In a functional language, that would be called a fold. It's very popular in Haskell.

I like that Perl 6 seems to be taking steps in the direction of functional languages. First lazy lists (0..Inf) and now a fold. :-D

Daniel.

Reply via email to