SetDelayed

lhs:=rhs

assigns rhs to be the delayed value of lhs. rhs is maintained in an unevaluated form. When lhs appears, it is replaced by rhs, evaluated afresh each time.

Details

  • SetDelayed has attribute HoldAll, rather than HoldFirst.
  • You can make assignments of the form lhs:=rhs/;test, where test gives conditions for the applicability of each transformation rule. You can make several assignments with the same lhs but different forms of test.
  • lhs:=rhs returns Null if the assignment specified can be performed, and returns $Failed otherwise.

Examples

open allclose all

Basic Examples  (1)

In[1]:=
Click for copyable input
In[2]:=
Click for copyable input
Out[2]=

Scope  (9)

Applications  (3)

Properties & Relations  (9)

Possible Issues  (4)

Neat Examples  (1)

See Also

Set  TagSetDelayed  Unset  Clear  RuleDelayed  Dynamic

Tutorials

Introduced in 1988
(1.0)