develooper Front page | perl.perl6.language | Postings from October 2001

reduce via ^

Thread Next
John Williams
October 10, 2001 03:59
reduce via ^
Message ID:
I just read Apocalypse and Exegesis 3, and something stuck out at me
because of its omission, namely using hyper operators for reduction.

$a ^+= @list;  # should sum the elements of @list

Larry says @a ^+ 1 will replicate the scalar value for all a's, and Damian
talks about doing summation with the reduce function without mentioning
this compact syntax.

So am I overlooking some obvious reason why this won't work?

~ John Williams

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About