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: [mg38964] Re: [mg38950] MatchQ[x^1, x^_Integer]
  • From: Andrzej Kozlowski <akoz at mimuw.edu.pl>
  • Date: Thu, 23 Jan 2003 08:03:02 -0500 (EST)
  • Sender: owner-wri-mathgroup at wolfram.com

x^1 evaluates to just x which is no longer of the form (=FullForm) 
Power[x,1]. Since the matching is syntactic and not semantic you do not 
get a match. However you do get one if instead you evaluate:

In[1]:=
MatchQ[Unevaluated[x^1],x^_Integer]

Out[1]=
True

or:

In[2]:=
MatchQ[x^1,x^_Integer:1]

Out[2]=
True

Andrzej Kozlowski

On Wednesday, January 22, 2003, at 08:10 PM, Kimberly Damon yamin wrote:

> MatchQ[x^1, x^_Integer]
> I got "False" result. I think I should get "True" for this.
> Could anyone explain this ?
>
> Thanks
>
>
>
Andrzej Kozlowski
Yokohama, Japan
http://www.mimuw.edu.pl/~akoz/
http://platon.c.u-tokyo.ac.jp/andrzej/



  • 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]