WORKFLOW
Substitute Values of Variables in Functions That Hold Their Arguments
Define a held expression that refers to the variable x:
![](Files/SubstituteValuesOfVariablesInFunctionsThatHoldTheirArguments.en/1.png)
Because Hold has the attribute HoldAll, x is not evaluated when the held expression is defined, so the body of the expression refers to the global variable x. The value of x is obtained when the Hold is released:
To effectively force x to evaluate when the held expression is defined, use With:
![](Files/SubstituteValuesOfVariablesInFunctionsThatHoldTheirArguments.en/2.png)
![](Files/SubstituteValuesOfVariablesInFunctionsThatHoldTheirArguments.en/3.png)
Now changes in the value of x have no effect on the value returned when the Hold is released: