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

Reply via email to