Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Move symbols into a context
ResourceFunction["Contextualize"][context,"name"] gives the symbol context`name. | |
ResourceFunction["Contextualize"][context,symbol] gives the symbol context`symbol. | |
ResourceFunction["Contextualize"][context,expr] contextualizes symbols within an expression. | |
ResourceFunction["Contextualize"][context] gives an operator for contextualizing expressions. |
"OnlyExistingNames" | True | whether to only apply context to names with existing symbols |
"BlobFormatting" | Automatic | function to create a blob |
ColorFunction | ResourceFunction["HashHue"] | color of the blob when using default blob formatting |
Define a function in a new context:
In[1]:= | ![]() |
Define the symbol using Contextualize:
In[2]:= | ![]() |
Out[2]= | ![]() |
Use it:
In[3]:= | ![]() |
Out[3]= | ![]() |
Use a symbol name instead:
In[4]:= | ![]() |
Out[4]= | ![]() |
Create a context blob:
In[5]:= | ![]() |
Out[5]= | ![]() |
Use the operator to get a symbol:
In[6]:= | ![]() |
Out[6]= | ![]() |
Apply the function using the operator:
In[7]:= | ![]() |
Out[7]= | ![]() |
Re-contextualize symbols with an expression:
In[8]:= | ![]() |
Out[8]= | ![]() |
Deeper contexts work as well:
In[9]:= | ![]() |
Create a context blob for the long context:
In[10]:= | ![]() |
Out[10]= | ![]() |
Use it:
In[11]:= | ![]() |
Out[11]= | ![]() |
Customize a context blob:
In[12]:= | ![]() |
In[13]:= | ![]() |
Out[13]= | ![]() |
Use it:
In[14]:= | ![]() |
Out[14]= | ![]() |
In[15]:= | ![]() |
Out[15]= | ![]() |
Choose the background color:
In[16]:= | ![]() |
Out[16]= | ![]() |
This work is licensed under a Creative Commons Attribution 4.0 International License