Help for this page

Select Code to Download


  1. or download this
      sub sum {
        my($term, $a, $next, $b) = @_;
        return 0 if $a > $b;
        return &$term($a) + sum($term, &$next($a), $next, $b);
      }
    
  2. or download this
      sub sum {
        my($term, $a, $next, $b) = @_;
        return 0 if $a > $b;
        return $term->($a) + sum($term, $next->($a), $next, $b);
      }