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

reduce via ^

Thread Next
From:
John Williams
Date:
October 10, 2001 03:59
Subject:
reduce via ^
Message ID:
Pine.LNX.4.21.0110081923490.29694-100000@sharkey.morinda.com
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


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About