Mathematica > Core Language > Rules & Patterns > Rules >

RuleDelayed

lhs:>rhs or lhsRuleDelayedrhs
represents a rule that transforms lhs to rhs, evaluating rhs only after the rule is used.
  • You can apply rules using Replace.
  • The assignment lhs:=rhs specifies that the rule lhs:>rhs should be used whenever it applies.
  • You can use Condition to specify when a particular rule applies.
:> holds its right-hand side unevaluated:
In[1]:=
Click for copyable input
Out[1]=
The right-hand side is evaluated separately each time it is used:
In[2]:=
Click for copyable input
Out[2]=
New in 1 | Last modified in 3
Ask a question about this page  |  Suggest an improvement  |  Leave a message for the team