This is documentation for Mathematica 3, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.2)
 Documentation / Mathematica / Built-in Functions / Programming / Rule Application  /

  • lhs :> rhs or lhsrhs represents a rule that transforms lhs to rhs, evaluating rhs only after the rule is used.
  • The character can be entered as :> or \[RuleDelayed].
  • RuleDelayed has the attribute HoldRest.
  • 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.
  • lhsrhs can be entered as lhs \[RuleDelayed] rhs or lhs :> rhs.
  • In StandardForm, RuleDelayed is printed using .
  • See notes for Rule.
  • See the Mathematica book: Section 2.4.1Section A.5.5.
  • See also: Replace, SetDelayed, Rule.

    Further Examples

    The right-hand side of this rule is evaluated when you give the rule.



    A rule like this is probably not particularly useful.



    Here, the right-hand side of the rule is maintained in an unevaluated form, to be evaluated every time the rule is used.



    Applying the rule causes the expansion to be done.