> As Stavros pointed out, Maxima doesn't have lexical closures,
> but in many cases we can work around this deficiency by means
> of BUILDQ.
Though Buildq is appropriate for writing macros, I think it is a rather
ugly quasi-emulation of lexical scope, especially because of the need
for that Gensym workaround. Until Maxima has true lexical scope, I
think it's best to avoid such things and use Maxima in ways which are
"natural" for it.
I am also not sure why you are defining A as a prefix operator. Why not
just use normal functional notation, e.g. A(exp)(x) or (perhaps more
clearly) (A(exp))(x)? This does *not* cause an error as TWS says.
-s