Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Insert the values of symbols into an expression before evaluation
ResourceFunction["Inline"][symbol,expr] inserts the value of symbol into expr. | |
ResourceFunction["Inline"][{sym1,sym2,…},expr] inserts the values of the symbols sym1,sym2,… into expr. |
Inline the value of a symbol into a held expression:
In[1]:= |
In[2]:= |
Out[2]= |
Retrieve the ResourceFunction:
In[3]:= |
Out[3]= |
Retrieve the ResourceObject:
In[4]:= |
Out[4]= |
Inline multiple symbols:
In[5]:= |
In[6]:= |
Out[6]= |
For values defined with Set, Inline is functionally similar to using With in order to insert values:
In[7]:= |
In[8]:= |
Out[8]= |
In[9]:= |
Out[9]= |
Inline also works for delayed values without evaluating the value:
In[10]:= |
In[11]:= |
Out[11]= |
In[12]:= |
Out[12]= |
Inline a function into an expression:
In[13]:= |
Out[16]= |
Limit the number of replacements that are made:
In[17]:= |
Out[36]= |
Patterns are matched using the unevaluated expression:
In[37]:= |
Out[40]= |
Recursive functions usually cannot be completely eliminated:
In[41]:= |
Out[44]= |
Wolfram Language 11.3 (March 2018) or above
This work is licensed under a Creative Commons Attribution 4.0 International License