Following the lead of the sort operator, it would be a little simpler to see reduce expressions use $a and $b instead of $_[0], $_[1]. E.g. Summation: $sum = reduce {$a + $b} 0, @numbers; $sum = reduce sub{$a + $b}, 0, @numbers; Production: $prod = reduce {$a * $b} 1, @numbers; $prod = reduce sub{$a * $b}, 1, @numbers; Following grep, map, sort, reduce should be able to accept all these forms - currently the form seems to be like sort than grep and map. reduce $a + $b, @list # grep, map reduce {$a + $b} @list # grep, map, sort reduce sum2 @list # sort reduce sub{$a + $b}, @list # sort Adam Krolnik Verification Mgr. LSI Logic Corp. Plano TX. 75074
- Re: RFC 76 (v1) Builtin: reduce Damian Conway
- Re: RFC 76 (v1) Builtin: reduce Damian Conway
- Re: RFC 76 (v1) Builtin: reduce Jeremy Howard
- Re: RFC 76 (v1) Builtin: reduce Damian Conway
- Re: RFC 76 (v1) Builtin: reduce Glenn Linderman
- Re: RFC 76 (v1) Builtin: reduce Damian Conway
- Re: RFC 76 (v1) Builtin: reduce John Porter
- Re: RFC 76 (v1) Builtin: reduce Piers Cawley
- Re: RFC 76 (v1) Builtin: reduce Graham Barr
- Re: RFC 76 (v1) Builtin: reduce Damian Conway
- Re: RFC 76 (v1) Builtin: reduce Adam Krolnik
- Re: RFC 76 (v1) Builtin: reduce Jarkko Hietaniemi
- Re: RFC 76 (v1) Builtin: reduce Nathan Wiger
- Re: RFC 76 (v1) Builtin: reduce Piers Cawley
- Re: RFC 76 (v1) Builtin: reduce Nathan Torkington
- Re: RFC 76 (v1) Builtin: reduce Jeremy Howard
- Re: RFC 76 (v1) Builtin: reduc... Bart Lateur
- Re: RFC 76 (v1) Builtin: reduc... Jeremy Howard
- Re: RFC 76 (v1) Builtin: reduc... Damian Conway
- Re: RFC 76 (v1) Builtin: reduce Ariel Scolnicov
- Re: RFC 76 (v1) Builtin: reduce Jeremy Howard