How do you decorate or annotate a variable in a replacement rule?
For example
{(e[(-X + Y)^2 || f])} //. {e[(-a_ + b_)^2 || f] -> (-a + b)^2}
Would ideally return:
(-lagXdt + lagYdt)^2
Update:
The following does not return lagXdt
and lagYdt
but rather lagadt
and lagbdt
:
{(e[(-X + Y)^2 || f])} //. {e[(-a_ + b_)^2 ||
f] -> (-Symbol["lag" <> ToString@a <> "dt"] +
Symbol["lag" <> ToString@b <> "dt"])^2}
//
was supposed to be. $\endgroup$