MathGroup Archive 2011

[Date Index] [Thread Index] [Author Index]

Search the Archive

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?


  • Prev by Date: Re: Simple integral
  • Next by Date: Trouble Constructing Continuous Wavelet Transform in Mathematica 8
  • Previous by thread: Re: General PDF/EMF export problems and solutons
  • Next by thread: Re: Problem combining patterns