MathGroup Archive 2003

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

Search the Archive

RE: MatchQ[x^1, x^_Integer]

  • To: mathgroup at smc.vnet.net
  • Subject: [mg38969] RE: [mg38950] MatchQ[x^1, x^_Integer]
  • From: "David Park" <djmp at earthlink.net>
  • Date: Thu, 23 Jan 2003 08:03:19 -0500 (EST)
  • Sender: owner-wri-mathgroup at wolfram.com

Kimberly,

Because Mathematica evaluates and simplifies x^1 to x, which does not match
your form.

x^1 // FullForm
x

But this works...

MatchQ[Unevaluated[x^1], x^_Integer]
True

Understanding and controlling order of evaluation in Mathematica is probably
one of its toughest aspects. Fortunately, most of the time things work the
way you want.

David Park
djmp at earthlink.net
http://home.earthlink.net/~djmp/

From: Kimberly Damon yamin [mailto:dykim92 at yahoo.com]
To: mathgroup at smc.vnet.net

MatchQ[x^1, x^_Integer]
I got "False" result. I think I should get "True" for this.
Could anyone explain this ?

Thanks




  • Prev by Date: Re: MatchQ[x^1, x^_Integer]
  • Next by Date: Re: MatchQ[x^1, x^_Integer]
  • Previous by thread: Re: MatchQ[x^1, x^_Integer]
  • Next by thread: Re: MatchQ[x^1, x^_Integer]