Condition::condp

更多信息

  • This message is generated when a pattern expression appears on the right-hand side of a Condition pattern.
  • This message is a warning about a use of pattern expressions that is often an error. In most useful patterns, pattern expressions will only appear on the left-hand side of a condition.
  • Pattern expressions associated with this warning are typically entered using the underscore character, such as p_, and Condition[patt, cond] is typically entered as patt/;cond. This message can be generated if underscore patterns occur within cond.
  • Off[message] switches off the message; On[message] switches it on. For example: Off[Condition::condp].

范例

基本范例  (1)

The pattern expression appears in an unusual position in the condition:

This shows a more typical use of patterns in a condition: