OrderlessPatternSequence

OrderlessPatternSequence[p1,p2,]

is a pattern object that represents a sequence of arguments matching p1,p2, in any order.

Details

Examples

open allclose all

Basic Examples  (3)

Match elements of a list in any order:

In[1]:=
Click for copyable input
Out[1]=
In[2]:=
Click for copyable input
Out[2]=

Match function arguments in any order:

In[1]:=
Click for copyable input
Out[1]=

The ordering of matched expressions is preserved:

In[1]:=
Click for copyable input
Out[1]=
In[2]:=
Click for copyable input
Out[2]=

Scope  (2)

Properties & Relations  (1)

Possible Issues  (1)

See Also

PatternSequence  Orderless  Repeated  Alternatives  AnyOrder  KeyValuePattern

Introduced in 2015
(10.1)