Wolfram ResearchPRODUCTSPURCHASEFOR USERSCOMPANYOUR SITES
THIS IS DOCUMENTATION FOR AN OBSOLETE PRODUCT.
SEE THE DOCUMENTATION CENTER FOR THE LATEST INFORMATION.

Condition

Usage

patt /; test is a pattern which matches only if the evaluation of test yields True.
lhs :> rhs /; test represents a rule which applies only if the evaluation of test yields True.
lhs := rhs /; test is a definition to be used only if test yields True.


Notes

• Example: The pattern x_ /; x > 0 represents an expression which must be positive.
• All pattern variables used in test must also appear in patt.
• Example: f[x_] := fp[x] /; x > 1 defines a function in the case when  .
lhs := Module[{vars}, rhs /; test] allows local variables to be shared between test and rhs. You can use the same construction with Block and With.
• New in Version 1.


Any questions about topics on this page? Click here to get an individual response.Buy NowFree TrialMore Information



 © 2008 Wolfram Research, Inc.  Terms of Use  Privacy Policy |
Sign up for our newsletter: