On 1/16/07, Michel Van den Bergh <michel.vandenbergh at uhasselt.be> wrote:
> Maybe I should give the specific problem I was looking at.
> The model is an expression (i.e. bfloat(t)) in which you substitute
> values for certain variables and then you want to
> "evaluate it" to get a numeric result, if possible. How to do this
> without invoking ev?
I guess I don't understand the point of avoiding MEVAL.
That is not something I would recommend to users,
and it's not clear to me why it was recommended to you.
Maxima calls MEVAL left and right; you really have to go to
extremes to avoid it completely, and clog up your program with
a lot of circumlocutions. If ev and/or MEVAL have some specific
problems, then let's fix them.
That said, maybe buildq + a simplification rule for the functions
of interest have the effect you want. buildq carries out the
substitution, simplification emulates the function call.
E.g. pseudo-evaluation of foo(x) for a specific value of x:
matchdeclare (a, all);
tellsimpafter (foo(a), 1 - a);
buildq ([x : %pi], foo(x));
=> 1 - %pi
But trace(?meval) shows that MEVAL is being called even in this case.
All the best,
Robert