OpenersNotesSection(Spacer1)Details

This message is generated when a pattern based on (RefLink[Optional, paclet:ref/Optional]) is used without specifying a default value for the pattern.

The notation patt. is used for (RefLink[Optional, paclet:ref/Optional])[patt].

Assignments to (RefLink[Default, paclet:ref/Default]) are used for specifying default values for (RefLink[Optional, paclet:ref/Optional]) patterns.

(RefLink[Off, paclet:ref/Off])[message] switches off the message; (RefLink[On, paclet:ref/On])[message] switches it on. For example: (RefLink[Off, paclet:ref/Off])[Pattern::nodef].

OpenersPrimaryExamplesSection(Spacer1)Examples  (1)

OpenersExampleSection0(Spacer1)Basic Examples  (1)

A (RefLink[Default, paclet:ref/Default]) value has not been assigned for an (RefLink[Optional, paclet:ref/Optional]) pattern in the test function:

test[]/.test[p_.]->{p,p+1}

This shows a valid assignment to (RefLink[Default, paclet:ref/Default]) for use with an (RefLink[Optional, paclet:ref/Optional]) pattern that occurs as an argument in the test function:

Default[test,1]=0

test[]/.test[p_.]->{p,p+1}

Clear the (RefLink[Default, paclet:ref/Default]) rule for the test function:

Default[test,1]=.

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(RefLink[Pattern, paclet:ref/Pattern])}})}})