remvalue, was: Strange plot2d behaviour (correction)



It makes sense for plot2d to try to do something with the function it is
plotting because it is being called many times.  Compiling it to a numerical
function that returns a floating point value is an attractive alternative,
in order to make it run faster. It is also possible that one wants to mangle
the semantics, on the basis that anything that is not a float is
unacceptable. But this is risky.  Mathematica got into trouble with its
"compiler" because the compiler assumed that all internal computations in
the function being compiled (and plotted) were REAL.  In fact, there may be
functions you want to plot that use COMPLEX arithmetic or other constructs
internally, but result in a REAL number for plotting.  Anyway, such
functions could not be plotted in Mathematica (version 3?) without turning
off the compiler.  (At least that is what I recall).   

The issue remains as to what you are really trying to do. I doubt that
remvalue() is serving a useful purpose in terms of scope, information
hiding, or saving memory.

RJF

> -----Original Message-----
> From: maxima-bounces at math.utexas.edu 
> [mailto:maxima-bounces at math.utexas.edu] On Behalf Of Michel 
> Van den Bergh
> Sent: Monday, January 01, 2007 9:33 AM
> To: maxima at math.utexas.edu
> Subject: remvalue, was: Strange plot2d behaviour (correction)
> 
> The example got mangles
> >/
> />/ 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].
> /
> This appears to not quite correct. Modifying the example again.
> 
> (%i1) g(s):=block([],print(values),s)$
> (%i2) g(2);
> [s,s__]
> (%o2)                          2
> 
> But!!!
>                                  
> (%i3)  plot2d(g,[s,1,2]);
> [s__]
> [s__]
> [s__]
> [s__]
> [s__]
> ...
> Now s has disappeared from the value list....
> 
> Michel
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
>