[Maxima] Newbie question about scoping rules
Michel Van den Bergh
michel.vandenbergh at uhasselt.be
Thu Dec 28 02:25:12 CST 2006
>here is a global variable called arrays, which is a list of arrays. If
>you want a local array, you need to
>use the function local inside the block with the array name as an argument.
>Otherwise, the array will be entered into the global array namespace.
>I think this is because Macsyma has array functions, and functions are
The problem is the scope of an array which is a parameter. Here is the
example by miguel lopez
The following definition only partially fixes the problem
Now g(t) returns 64 (as it should). However g(s) returns s_4 instead of 16....
Should one use
and hope the user does not accidentally define an array _s?
More information about the Maxima