Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #2740 > unrolled thread

Problem combining patterns

Started byRui <rui.rojo@gmail.com>
First post2011-05-27 10:12 +0000
Last post2011-05-27 10:12 +0000
Articles 1 — 1 participant

Back to article view | Back to comp.soft-sys.math.mathematica


Contents

  Problem combining patterns Rui <rui.rojo@gmail.com> - 2011-05-27 10:12 +0000

#2740 — Problem combining patterns

FromRui <rui.rojo@gmail.com>
Date2011-05-27 10:12 +0000
SubjectProblem combining patterns
Message-ID<irntf2$sn9$1@smc.vnet.net>
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?

[toc] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web