MathGroup Archive 2009

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

Search the Archive

Re: MatchQ, silly question


Mathematica evaluates all arguments and hence _ _^_  gets evaluated as
well. Since the underscore is simply the function Blank[] this becomes
Blank[] Blank[]^Blank[]. This can be simplified to Blank[]^(Blank[]
+1). And now, the two structures are dissimilar and don't match. To
prevent this, the blanks indeed need to be labeled to prevent
simplification.

Cheers -- Sjoerd

On Nov 20, 1:41 pm, janos <janostothmeis... at gmail.com> wrote:
> MatchQ[3 x^2, #] & /@ {3 x_^2,  3 x_^_, _ x_^_, _ _^_, _ (_^_), _ *
> (_^_)}
>
> dives False in the last cases. Why? The FullForm
>
> Power[Blank[ ],Plus[1,Blank[ ]]]
>
> contains Plus, why?
>
> Thank you.
>
> J=E1nos



  • Prev by Date: Re: Undo in Mathematica
  • Next by Date: Re: PolarPlot goes upto 1.2 on axis, not 1?
  • Previous by thread: Re: MatchQ, silly question
  • Next by thread: Re: MatchQ, silly question