Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Copy the definitions of one symbol to another
ResourceFunction["CopyDefinitions"][f,g] copies the definitions of f into the definitions of g. |
Use the function:
| In[1]:= | ![]() |
| Out[1]= |
Using Set or SetDelayed can achieve similar behavior:
| In[4]:= | ![]() |
| Out[4]= |
However, the new symbol will still be dependent on the old:
| In[5]:= |
| Out[5]= |
| In[6]:= |
| Out[6]= |
CopyDefinitions will eliminate dependencies on the original:
| In[7]:= | ![]() |
| Out[7]= |
| In[8]:= |
| Out[8]= | ![]() |
| In[9]:= |
| Out[9]= |
Wolfram Language 11.3 (March 2018) or above
This work is licensed under a Creative Commons Attribution 4.0 International License