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:

Match function arguments in any order:

The ordering of matched expressions is preserved:

Scope  (2)

Use OrderlessPatternSequence to make some of the function arguments orderless:

Only the last two arguments of g are orderless:

Find the positions of lists that have two 1s and one 0:

Properties & Relations  (1)

During expression pattern matching, PatternSequence matches expressions in fixed order:

OrderlessPatternSequence matches expressions in arbitrary order:

Possible Issues  (1)

OrderlessPatternSequence matches against a sequence of patterns:

Wolfram Research (2015), OrderlessPatternSequence, Wolfram Language function, https://reference.wolfram.com/language/ref/OrderlessPatternSequence.html.

Text

Wolfram Research (2015), OrderlessPatternSequence, Wolfram Language function, https://reference.wolfram.com/language/ref/OrderlessPatternSequence.html.

CMS

Wolfram Language. 2015. "OrderlessPatternSequence." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/OrderlessPatternSequence.html.

APA

Wolfram Language. (2015). OrderlessPatternSequence. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/OrderlessPatternSequence.html

BibTeX

@misc{reference.wolfram_2024_orderlesspatternsequence, author="Wolfram Research", title="{OrderlessPatternSequence}", year="2015", howpublished="\url{https://reference.wolfram.com/language/ref/OrderlessPatternSequence.html}", note=[Accessed: 22-December-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_orderlesspatternsequence, organization={Wolfram Research}, title={OrderlessPatternSequence}, year={2015}, url={https://reference.wolfram.com/language/ref/OrderlessPatternSequence.html}, note=[Accessed: 22-December-2024 ]}