SetDelayed
lhs := rhs
sets lhs
to stand for rhs
, with rhs
not being evaluated until it is referenced by lhs
.
Attributes[SetDelayed] := {HoldAll, Protected, SequenceHold}
Simple examples
SetDelayed
can be used to define functions:
testa[k]
, so the general case matches:
Further examples
Set
has the HoldFirst
attribute, meaning rhs
is evaluated before assignment:
SetDelayed
has the HoldAll
attribute, meaning rhs
is not evaluated during assignment: