Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Compress an expression, along with any needed definitions, so that it can be used in another session
ResourceFunction["CompressWithDefinitions"][expr] compresses expr along with its dependent definitions. |
Compress an expression with dependent definitions:
| In[1]:= | ![]() |
| Out[1]= | ![]() |
Definitions are restored when uncompressed:
| In[2]:= |
| Out[2]= |
The compressed expression is an evaluation that restores definitions before returning the output:
| In[5]:= | ![]() |
| In[6]:= |
| Out[6]= | ![]() |
Compress by itself does not preserve definitions:
| In[7]:= |
| Out[7]= |
| In[8]:= |
| Out[8]= | ![]() |
| In[9]:= |
| In[10]:= |
| Out[10]= |
| In[11]:= |
| Out[11]= |
Wolfram Language 11.3 (March 2018) or above
This work is licensed under a Creative Commons Attribution 4.0 International License