is an attribute that specifies that Sequence objects appearing in the arguments of a function should not automatically be flattened out.
SequenceHold
is an attribute that specifies that Sequence objects appearing in the arguments of a function should not automatically be flattened out.
Details
- The attribute SequenceHold prevents Sequence objects from being flattened out.
Examples
open all close allBasic Examples (1)
Add SequenceHold to the list of attributes of the symbol h:
SetAttributes[h, SequenceHold];Then Sequence objects are not automatically spliced into expressions with head h:
h[a, Sequence[b, c]]Properties & Relations (3)
The attribute HoldAll does not prevent splicing of sequences:
Attributes[Hold]Hold[a, Sequence[b, c]]SequenceHold is also necessary:
SetAttributes[h, {HoldAll, SequenceHold}];h[a, Sequence[b, c]]The attribute HoldAllComplete implies SequenceHold:
Attributes[HoldComplete]HoldComplete[a, Sequence[b, c]]Assignment operators are SequenceHold, so that sequences can be returned as results:
splice[x_] := Sequence[x, x, x]{a, splice[b], c}{f[1], g[2], h[3]} /. g[x_] :> Sequence[x, x]See Also
Tech Notes
Related Guides
Related Workflows
- Handle Code Symbolically
History
Introduced in 1996 (3.0)
Text
Wolfram Research (1996), SequenceHold, Wolfram Language function, https://reference.wolfram.com/language/ref/SequenceHold.html.
CMS
Wolfram Language. 1996. "SequenceHold." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/SequenceHold.html.
APA
Wolfram Language. (1996). SequenceHold. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/SequenceHold.html
BibTeX
@misc{reference.wolfram_2026_sequencehold, author="Wolfram Research", title="{SequenceHold}", year="1996", howpublished="\url{https://reference.wolfram.com/language/ref/SequenceHold.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_sequencehold, organization={Wolfram Research}, title={SequenceHold}, year={1996}, url={https://reference.wolfram.com/language/ref/SequenceHold.html}, note=[Accessed: 13-June-2026]}