function parameters



'ev' is a very idiosyncratic function, which should rarely be used within
functions, especially given Maxima's dynamic scope rules.
Even at the top level, you have to be careful....

               -s

On Wed, Apr 21, 2010 at 05:15, Mikhail Khokhlov <aeol at mail.ru> wrote:

> Hi,
>
> Is it a bug, or am I doing something wrong?
>
> (%i1) myfun(a) := ev(a);
> (%o1)                          myfun(a) := ev(a)
> (%i2) myfun(a+b);
> (%o2)                               2 b + a
>
> Obviously, "a" evaluates to "a+b" twice in this example. Why does this
> happen? Function parameter should evaluate to its value only once,
> regardless of what its name is.
>
> Best regards,
> Mikhail Khokhlov
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
>