This is documentation for Mathematica 5, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.2)

Documentation / Mathematica / Built-in Functions / Programming / Assignments /

TagSet

FilledSmallSquare f/: lhs = rhs assigns rhs to be the value of lhs, and associates the assignment with the symbol f.

FilledSmallSquare TagSet defines upvalues or downvalues as appropriate.

FilledSmallSquare The symbol f in f/: lhs = rhs must appear in lhs as the head of lhs, the head of the head, one of the elements of lhs, or the head of one of the elements.

FilledSmallSquare A common case is f/: h[f[args]] = rhs.

FilledSmallSquare You can see all the rules associated with a particular symbol by typing ?symbol.

FilledSmallSquare If f appears several times in lhs, then f/: lhs = rhs associates the assignment with each occurrence.

FilledSmallSquare When it appears in symbolic form, TagSet is treated as a scoping construct (see Section A.3.8).

FilledSmallSquare See Section 2.5.10 and Section A.5.2.

FilledSmallSquare See also: Set, UpSet.

FilledSmallSquare New in Version 1.