how to pass the name of a variable as argument?



Robert Dodier wrote:
> On Thu, May 1, 2008 at 6:14 PM, Oliver Kullmann
> <O.Kullmann at swansea.ac.uk> wrote:
> 
>>  Since global variables should be avoided,
> 
> Bear in mind that, in Maxima, effectively ALL variables are global variables,
> or, more precisely, global variables and local variables act the same.
> All variables have dynamic scope, not lexical scope.
> 
> As you doubtless know, dynamic scope can lead to subtle misbehavior.
> A lexically-scoped user language could be very useful.
> Instead of revising the existing Maxima language, at this point I think
> the easiest way to get lexical scope is to run a different language
> on top of Lisp. One possibility is Python; there is a CL implementation

Why is implementing a different language helpful?  Surely we can make 
maxima lexical if desired, without breaking everything.  (Of course, 
some things will break.)  After all there is an existence proof of such 
a change:  Maclisp (or any other early lisp that only had dynamic scope) 
and Common Lisp.

The maxima translate function also kind of points the way too, since the 
translated code sprinkles special declarations all over to make the 
variables all special.  Removing those would give us lexical behavior, 
but only for translated code.  I would think something similar could be 
done with the interpreter.

Ray