Functions may leak information about names(!) of local variables.
Subject: Functions may leak information about names(!) of local variables.
From: Dan Stanger
Date: Thu, 28 Dec 2006 20:40:27 -0500
One thing that you can do is to use the :: operator instead of :, by
creating a variable using gensym.
For example a:?gensym() /* now a is a pointer to a variable */
a[1]::2 /* assigns the variable pointed to by a, to 2 */
Also, the gensym variable is entered into the arrays list.
Many of these array questions can be answered by looking at the
commercial Macsyma's demo documentation,
which is freely available.
Dan Stanger
Michel Van den Bergh wrote:
>I really don't see how to do robust programming in maxima.
>
>Consider
>
>g(s):=block([t],local(t), t[4]:subvar(s,4), t[4]);
>t[n]:=n^3;
>u[n]:=n^4;
>
>g(u);
> 256
>g(t);
> t_4
>
>What is the correct way of dealing with this? Or should one just say that
>arrays are not first class objects and should not be passed around in
>this way?
>That would be a pity.
>
>Michel
>
>_______________________________________________
>Maxima mailing list
>Maxima at math.utexas.edu
>http://www.math.utexas.edu/mailman/listinfo/maxima
>
>
>
>