

Condition 
Examples
open all close allBasic Examples (2)
Scope (2)
Share a variable between a condition and function body:
Use Condition inside a function body to control evaluation:
Properties & Relations (2)
Condition evaluates a Boolean expression on named parts of a pattern:
PatternTest applies test functions to patterns, which need not have names:
Possible Issues (1)
Repeated[p /; test] requires that every named pattern in p have the same value throughout the sequence:
The same is true of RepeatedNull:
Use PatternTest in combination with unnamed patterns to allow a sequence of nonidentical elements:
See Also
Except If Switch Which PatternTest Restricted Element Piecewise
Tech Notes
Related Guides
Related Workflows
- Write a Function That Can Return Unevaluated
History
Introduced in 1988 (1.0)
Text
Wolfram Research (1988), Condition, Wolfram Language function, https://reference.wolfram.com/language/ref/Condition.html.
CMS
Wolfram Language. 1988. "Condition." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/Condition.html.
APA
Wolfram Language. (1988). Condition. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/Condition.html
BibTeX
@misc{reference.wolfram_2025_condition, author="Wolfram Research", title="{Condition}", year="1988", howpublished="\url{https://reference.wolfram.com/language/ref/Condition.html}", note=[Accessed: 14-August-2025]}
BibLaTeX
@online{reference.wolfram_2025_condition, organization={Wolfram Research}, title={Condition}, year={1988}, url={https://reference.wolfram.com/language/ref/Condition.html}, note=[Accessed: 14-August-2025]}