[Maxima] problem with recursive functions (erratum)

Stavros Macrakis macrakis
Fri Oct 6 12:52:47 CDT 2006


I wrote:

> f[d]:subst(d,'d,'( lambda([x],2*f[d-1](x)) ))$


This should have been

  f[d]:= subst(d,'d,'( lambda([x],2*f[d-1](x)) ))$

Sorry.

By the way, the normal recursive version (with no use of lexical scoping)
would be

f(d,x) := if d=1 then makelist(i, i, 1, x) else 2*f(d-1,x)$

This is simpler, clearer (to my eye), and probably faster than the f[]
approach.

              -s
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.math.utexas.edu/pipermail/maxima/attachments/20061006/7b8323ec/attachment.htm 



More information about the Maxima mailing list