MathGroup Archive 2011

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

Search the Archive

Re: what's wrong?!!

  • To: mathgroup at smc.vnet.net
  • Subject: [mg115715] Re: what's wrong?!!
  • From: Fred Klingener <gigabitbucket at BrockEng.com>
  • Date: Wed, 19 Jan 2011 05:25:21 -0500 (EST)
  • References: <ih16b7$jiq$1@smc.vnet.net>

On Jan 17, 5:40 am, olfa <olfa.mra... at yahoo.fr> wrote:
> Hi Mathematica community,
>
> I try to use Case[exp,patt,Infinity]
>
> for the first example it works:
> Cases[iP == i + v && kaP == 3^v,  iP == _ | kaP == _, I=
nfinity]
> the output is  {iP == i + v, kaP == 3^v}
>
> but not for the second one!!
>  Cases[yP == y + x - z, yP == _, Infinity]
> the output is  {}
>
> why?!!

Another way to fix the level spec is to explicitly Head the first
argument as a List:

Cases[ { yP == y + x - z }, yP == _, Infinity]

Your first case works because of the List inside the And. As usual, be
sure you know what the FullForm of the argument is.

Sympathies,
Fred Klingener





  • Prev by Date: Re: Array of arrays of various sizes and compile
  • Next by Date: Re: SetOptions does not work with Grid
  • Previous by thread: Re: what's wrong?!!
  • Next by thread: Re: what's wrong?!!