How to assign values to variables



Hi,

Stavros Macrakis wrote:

>     I do not want to re-assign the matrix U, I want a way to assign an
>     expression to a symbol, at a layer that permits
>     to write a function like :
>
>     assign(var1,var2); so that at the end, value of var2 is assigned
>     to the
>     symbol passed to var1 so if I enter :
>     bar:5;
>     foo:cos(x);
>     bar; -> 5
>     assign(bar,foo);
>     bar; -> cos(x)
>
>
> assign(a,b) := a::b $
> assign( ' bar,foo)$         note the quotation mark
> bar => cos(x)
>
> a: x^2$
> leftside: 'a$
> val: 5$
> assign(leftside,val)   or simply   leftside::val
> a =>

that is great, perfect. Thanks again.


Paul