You could use the common lisp package system to protect your
variables from everyone elses. I suspect that GCL's package
system is not quite ANSI standard, but should still work.
Thus you write your bessel package and export the names of
the interface functions.
I don't know exactly how you ended up in the particular bug stage,
but (let ((P (make-array ...)) ... (aref P i) should use the local
P regardless of any special variable named P. If you are using
the array P "nonlocally" then you must declare YOUR P to be
special.
RJF
Raymond Toy wrote:
> While working on some Bessel routines for maxima (via f2cl), I ran
> into an annoying thing: maxima is littered with special variables
> with short, simple names.
>
> For example, P is a special variable that prevented my Bessel code
> from working because it used P as an array to hold some coefficients
> for the approximation. Since P is special, the code accessed the
> special variable instead of my array. Ugh.
>
> It would be nice if they followed the usual Lisp practice of
> surrounding the name with *'s. It would also be nice if maxima used
> lexical scope, but perhaps that's a bit too much to ask for right now.
>
> Ray
> _______________________________________________
> Maxima mailing list
> Maxima@www.math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
>