functions as arguments



I didn't include definitions for f and g. Here
they are

(C1)  xsum(f, n) := block([s : 0],
  for k : 1 thru n do (s : s + apply(f, [k])), s)$
(C2) f(x) := x$
(C3) g(x) := x^2$
(C4) xsum(f,2);
(D4)                                   3
(C5) xsum(g,2);
(D5)                                   5

(C6)  ysum(f, n) := block([s : 0],
  for k : 1 thru n do (s : s + f(k)), s)$
(C7) ysum(f,2);
(D7)                                   3
(C8) ysum(g,2);
(D8)                                   3
(C9) translate(ysum)$
(C10) ysum(f,2);
(D10)                                  3
(C11) ysum(g,2);
(D11)                                  5
(C12) build_info();

Maxima version: 5.9.0.1cvs
Maxima build date: 6:44 5/6/2004
host type: i686-pc-mingw32
lisp-implementation-type: Kyoto Common Lisp
lisp-implementation-version: GCL 2.7.0

In Macsyma, ysum behaves the same as does Maxima before 
and after translating.  But Macsyma does give a warning 
saying that is similar to the warning Maxima buries in the 
UNLISP file.

Barton