Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Apply replacement rules to evaluated parts of expression
ResourceFunction["ReplaceAllUnheld"][expr,rules] applies a rule or list of rules in an attempt to transform each subpart of expr that would be automatically evaluated. |
In[1]:= | ![]() |
Out[1]= | ![]() |
Functions that hold some of their arguments:
In[2]:= | ![]() |
In[3]:= | ![]() |
In[4]:= | ![]() |
Out[4]= | ![]() |
Explicitly held expressions:
In[5]:= | ![]() |
Out[5]= | ![]() |
ReplaceAll applies the replacement rules to all arguments, whether held or evaluated:
In[6]:= | ![]() |
Out[6]= | ![]() |
No replacement happens, since ReplaceAllUnheld does not itself have have any Hold attributes:
In[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