On 11/2/07, Jaime Villate <villate at fe.up.pt> wrote:
> > Or you can define gnuplot_color as a Maxima
> > function to being with, via (MEVAL '(($DEFINE) (($GNUPLOT_COLOR) C) ...)).
> I get the following error:
> *** - EVAL: variable C has no value
Sorry, $DEFINE will attempt to evaluate (($GNUPLOT_COLOR) C).
Try MDEFINE instead of $DEFINE.
> and I cannot see any other program in src/ that uses a similar
> definition to use as an example.
Oh, (MEVAL '((MDEFINE) ...)) is just the Lisp equivalent of :=
in the interpreter. You can see how to formulate the Lisp
expression by entering gnuplot_color(c) := ... and then
entering :lisp $_ to see how it was parsed.
Another way is to write
(MPUTPROP '$GNUPLOT_COLOR ... 'MEXPR)
instead, where ... is a Maxima lambda expression.
gnuplot_color(c) := ... then :lisp (mget '$gnuplot_color 'mexpr)
shows what to put for the MEXPR property.
It's not clear to me whether (MEVAL '((MDEFINE) ...)) or
(MPUTPROP ... 'MEXPR) is preferable. Both of them assume
that some larger or smaller part of Maxima is already working
by the time they are evaluated.
best
Robert