symbol evaluation order



On 5/22/07, Brian W. <wells_br at yahoo.com> wrote:
>
> I am a maxima beginner, and I don't quite understand how expressions are
> evaluated. In the example session below (calculating the volumen V of a
> sphere with radius r, diameter d), the final evaluation ''V results in an
> expression containing d, although d is defined.


Brian, first of all, thanks for your interest in Maxima.

The two-single-quote operator is really a very special-purpose operator that
you should not normally need.  I would recommend you reserve it for those
special cases, such as substituting a value in a quoted expression.  Even
then, I would use it with care, since it doesn't work when you're
programming.  For reference, what '' does is evaluate the following
expression *at the time Maxima reads the expression*, not at the time it
evaluates it.  Enough said for now at least.

What should I have typed, so that the value of d is substituted in the
> evaluation? Of course I could write ''V,d=d; but I would like to have all
> known symbols substituded recursively (for more complicated examples).


The operation for substituting all current values recursively is ev(...,
infeval).  Note that the infeval is only obeyed by "ev", not by the general
evaluator.  You also have to be careful with infeval, as it can lead to
infinite loops.

              -s