Pattern::nodef
Details
-
- This message is generated when a pattern based on Optional is used without specifying a default value for the pattern.
- The notation patt. is used for Optional[patt].
- Assignments to Default are used for specifying default values for Optional patterns.
- Off[message] switches off the message; On[message] switches it on. For example: Off[Pattern::nodef].
Examples
Basic Examples (1)
A Default value has not been assigned for an Optional pattern in the test function:
test[] /. test[p_.] -> {p, p + 1}This shows a valid assignment to Default for use with an Optional pattern that occurs as an argument in the test function:
Default[test, 1] = 0test[] /. test[p_.] -> {p, p + 1}Clear the Default rule for the test function:
Default[test, 1]=.