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: [mg38981] Re: MatchQ[x^1, x^_Integer]
  • From: "Steve Luttrell" <luttrell at _removemefirst_westmal.demon.co.uk>
  • Date: Thu, 23 Jan 2003 08:05:11 -0500 (EST)
  • References: <b0lv4m$59l$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

MatchQ[x^1, x^_Integer]  gives False

but

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

The first result is because x^1 evaluates to x which doesn't match the
pattern x^_Integer. The second result is because Unevaluated prevents this
evaluation from occurring before the pattern matching.

--
Steve Luttrell
West Malvern, UK

"Kimberly Damon yamin" <dykim92 at yahoo.com> 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: MatchQ[x^1, x^_Integer]
  • Previous by thread: RE: MatchQ[x^1, x^_Integer]
  • Next by thread: Re: MatchQ[x^1, x^_Integer]