TransWikia.com

How to duplicate UpValue of one function to another?

Mathematica Asked on January 15, 2021

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?

One Answer

I have actually solved this question myself. Simply use

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

Correct answer by ablmf on January 15, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP