<A NAME=SET>
<TITLE>SET</TITLE></A>
<b><a href=r37_idx.html>INDEX</a></b><p><p>
<B>SET</B> _ _ _ _ _ _ _ _ _ _ _ _ <B>operator</B><P>
<P>
<P>
<P>
The <em>set</em> operator is used for assignments when you want both sides of
the assignment statement to be evaluated.
<P> <H3>
syntax: </H3>
<P>
<P>
<em>set</em>(<restricted\_expression>,<expression>)
<P>
<P>
<P>
<expression> can be any REDUCE expression; <restricted\_expression>
must be an identifier or an expression that evaluates to an identifier.
<P>
<P>
<P> <H3>
examples: </H3>
<P><PRE><TT>
a := y;
A := Y
set(a,sin(x^2));
2
SIN(X )
a;
2
SIN(X )
y;
2
SIN(X )
a := b + c;
A := B + C
set(a-c,z);
Z
b;
Z
</TT></PRE><P>Using an
<A HREF=r37_0188.html>array</A> or
<A HREF=r37_0345.html>matrix</A> reference as the first
argument to <em>set</em> has
the result of setting the contents of the designated element to
<em>set</em>'s second argument. You should be careful to avoid unwanted
side effects when you use this facility.
<P>
<P>
<P>