remvalue, was: Strange plot2d behaviour



On 1/1/07, Michel Van den Bergh <michel.vandenbergh at uhasselt.be> wrote:

> (%i1) g(s):=block([s__],s__:s,remvalue(s),s__)$
> (%i2) g(2);
> (%o2)                                  2
> (%i3) plot2d(g,[t,1,2]);
> Warning: Illegal `remvalue' attempt:
> s
> Warning: Illegal `remvalue' attempt:
> s

Well, the strangeness is in REMVALUE (src/suprv1.lisp),
which assumes that bound symbols must be on the Maxima values list
(the list which comprises variables that have been assigned values).
A Maxima function argument is bound but it is not on the values list,
so REMVALUE complains.

REMVALUE could be modified to unbind symbols even if they
are not on the values list; maybe that would be better.

If you just want to work with the symbol s verbatim, maybe you can
just write 's to prevent evaluation.

A Maxima trivia item -- function arguments don't appear on the
values list, but local variables in block do appear.
e.g. block([aa, bb, cc], print(values)) => prints out [aa, bb, cc].

All the best,
Robert Dodier