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: [mg38978] Re: MatchQ[x^1, x^_Integer]
  • From: atelesforos at hotmail.com (Orestis Vantzos)
  • Date: Thu, 23 Jan 2003 08:04:59 -0500 (EST)
  • References: <b0lv4m$59l$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

MatchQ evaluates x^1 to get x ... then x is compared with the pattern
and does not match, since syntactically it is not of the form
x^_Integer (it doesn't even have a Power head.)

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

Out[2]=
 1
x
x
           _Integer
MatchQ[x, x        ]
False

On the other hand MatchQ[x, x^_.] will match... see Default in the
Help Browser.
Orestis Vantzos

dykim92 at yahoo.com (Kimberly Damon yamin) wrote in message news:<b0lv4m$59l$1 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: rotate / view a graphics object
  • Previous by thread: Re: MatchQ[x^1, x^_Integer]
  • Next by thread: rotate / view a graphics object