Skip to content

Sequence

Sequence[e1, e2, ...] holds a list of expressions to be automatically inserted into another function.

Attributes[Sequence] := {Protected}

Simple examples

Sequence arguments are automatically inserted into the parent functions:

In[1]:= foo[a, Sequence[2, 3]]
Out[1]= foo[a, 2, 3]
Outside of the context of functions, Sequence objects do not merge:
In[2]:= Sequence[2, 3]
Out[2]= Sequence[2, 3]
In[3]:= Sequence[2, 3] + Sequence[5, 4]
Out[3]= 14
In[4]:= Sequence[2, 3]*Sequence[5, 4]
Out[4]= 120

Further examples

Empty Sequence[] objects effectively disappear:

In[1]:= foo[Sequence[]]
Out[1]= foo[]