Pattern::patv
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.
- Off[message] switches off the message; On[message] switches it on. For example: Off[Pattern::patv].
Examples
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}}