OpenersNotesSection(Spacer1)Details

This message is generated when the same name is used for both fixed-length patterns and variable-length patterns in the same rule.

A variable-length pattern is a pattern such as __ or ___ that can match expressions with variable length.

(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::patv].

OpenersPrimaryExamplesSection(Spacer1)Examples  (1)

OpenersExampleSection0(Spacer1)Basic Examples  (1)

The same symbol is used as the name of a pattern of fixed length and a pattern of variable length:

{1,4,3,2,1}/.{p_,p__}->{{p},{p}}

This rule can be applied without error if different names are used for the elements in the pattern:

{1,4,3,2,1}/.{p_,q__}->{{p},{q}}

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