Problem combining patterns
- To: mathgroup at smc.vnet.net
- Subject: [mg119257] Problem combining patterns
- From: Rui <rui.rojo at gmail.com>
- Date: Fri, 27 May 2011 06:12:54 -0400 (EDT)
Hey people.
I want to have an expression that evaluates to a pattern. Imagine
something simple
ClassPattern[]:=HoldPattern[i_/;Length[i]===1];
So far so good. But then I'd like to use it in compound expressions
like
MatchQ[{b[3], c[5]}, {ClassPattern[], ClassPattern[]}]
When I do so, the label "i" inside the pattern is treated as the same
in both ClassPatterns, so I get false. But I wanna get True in cases
like the one before
Any ideas?