Substitution in a function



I'm absolutely agree  that '' is not needed here. That was a mistake.
Originally,  I was thinking to make a new function via
f[2](u,v,w):=sublis([u=v,v=w,w=u],f[1](u,v,w)),
Because of my past experience in Mathematica I belived that I have to evaluate 
the rhs before (it is necessary sometimes in mathematica expressions).

Take care
Valerij
On Thursday 26 September 2002 11:02, Stavros Macrakis wrote:
> > I'm trying to permute some functions w.r.t. the variables they are
>
> using.
>
> Sublis is an excellent way to do this, as Valerij suggests, but I don't
> see any reason for using "''" in front of sublis here.  As a matter of
> fact, it appears to be a complete no-op (normally '' means substitute at
> parse time -- which would not work here -- but apparently in this
> context it does nothing at all).
>
> As for Neilen's original issue of "f:f,u=v,v=w,w=u" not behaving as
> expected within a function, the comma notation at the top level is a
> shorthand for using the "ev" function.  That is, at the top level
> command line,
>
>      f:f, u=v, v=w, w=u;
>
> is completely equivalent to
>
>      ev(f:f, u=v, v=w, w=u);
>
> You can verify this by printing the internal form of your C-line using
> ?print(C23) or whatever.
>
> Within a function, though, the "ev" must be explicit.  Thus, you could
> have said
>
>      ev(f:f,u=v,v=w,w=u) ,
>
> and that will work.  A bit clearer perhaps, would be
>
>      f : ev(f,u=v,v=w,w=u) .
>
> But I agree that sublis is a better way of doing this.
>
>         -s