• This message is generated when a pattern based on Optional appears in an invalid location within another pattern expression.
  • A pattern based on Optional cannot be used as the first argument in PatternTest, Condition, Repeated, RepeatedNull, or Optional, or as the second argument in Pattern.
  • Optional[p,v] can also be entered using the notation p:v.
  • Off[message] switches off the message; On[message] switches it on. For example: Off[General::patop].


Basic Examples  (1)

An error occurs because an Optional pattern is used as the second argument in a Pattern expression:

This shows a valid use of an Optional pattern: