5
$\begingroup$

Let's say I have defined a function zO for the following up-values

zO/:zO[x_]+zO[y_]:=zO[x+y];
zO/:zO[x_]+zo[y_]:=zO[x+y];
zO/:zO[x_]-zO[y_]:=zO[x+y];

Now I want to define another function zOE which have the same up-values. How can I do this without copying and modifying the above rules?

$\endgroup$
1
  • $\begingroup$ It's allowed to answer your own question. That way it's clearer that the problem was actually solved. $\endgroup$ Commented Nov 18, 2020 at 15:24

1 Answer 1

4
$\begingroup$

I have actually solved this question myself. Simply use

UpValues[zOE] = (UpValues[zO]/. zO->zOE)
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.