SequenceHold

Question:  What does the Attribute SequenceHold do for you?


Answer:  Rule (→) has the SequenceHold Attribute.  As a result a rule
such as the one in the next line can be used.  If Rule didn't have the
SequenceHold Attribute  Rule[y,Sequence[y1,y2,y3]]

would evaluate to  Rule[y, y1, y2, y3]  which is an invalid expression.

Clear["Global`*"] ;  {x, y, z}/.y->Sequence[y1, y2, y3]

{x, y1, y2, y3, z}


Nine built in commands have the SequenceHold Attribute.  They are:

Rule (→), RuleDelayed (:→), Set (=), SetDelayed (:=),
TagSet, TagSetDelayed, Timing, UpSet (:=), UpSetDelayed (^:=)


Created by Mathematica  (May 16, 2004)

Back to Ted’s Tricks index page