assigning to a symbol



On Nov 30, 2007 11:55 AM, Suresh Jeevanandam <jm.suresh at gmail.com> wrote:

> Got it:
>  lhs(eq) :: rhs(eq) did the job.

Another construct which is useful in this context is

  ev (foo, x = 1234);

which evaluates foo with x temporarily bound to 1234.
(I.e. no need for explicit assignment, and x is not permanently bound.)
This also works when the equation is given by a variable,
e.g. with, say, eqs equal to the list [x = 123, x = 456, x = 789],

  for e in eqs do print (ev (foo, e));

evaluates foo for each equation in eqs.

And when there is more than one variable to bind, say x and y,

  ev (foo, [x = 123, y = 456]);

is the same as

  ev (foo, x = 123, y = 456);

i.e. no need to unpack the equations from the list.

At the input prompt, Maxima understands

  foo, x = y;

to be the same as ev(foo, x=y).

HTH

Robert Dodier

PS. By the way how did you find "::" ? I am wondering about the
effectiveness of different forms of documentation ....