MathGroup Archive 2004

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

Search the Archive

Re: Cases

  • To: mathgroup at smc.vnet.net
  • Subject: [mg50439] Re: [mg50423] Cases
  • From: "Ingolf Dahl" <ingolf.dahl at telia.com>
  • Date: Sat, 4 Sep 2004 01:43:14 -0400 (EDT)
  • Reply-to: <ingolf.dahl at telia.com>
  • Sender: owner-wri-mathgroup at wolfram.com

Jerry,
I think Not[d] is only defined if d is True or False, and it is not a
pattern. Moreover, if a, b, c and d are undefined, Mathematica does not know
if they are equal or not. You might test if these symbols are identical:

Cases[x, y_ /; UnsameQ[y, d]]    

gives you 

{a, b, c}

Ingolf Dahl
Sweden

-----Original Message-----
From: Blimbaum, Jerry AA R22 [mailto:jerry.blimbaum at navy.mil] 
To: mathgroup at smc.vnet.net
Subject: [mg50439] [mg50423] Cases


Given:   x = {a,b,c,d,d};

Applying   Cases[x,d]   gives an output of {a,b,c}......

However, Cases[x,Not[d]] gives as output an empty list  { }... I
expected   {a,b,c}.....

Why didnt I get that?

This issue came up when using Thread on vectors...and in some cases the
Thread resulted in 0 == 0  so it's output in the list  was 
True....and I
wanted to remove them....

thanks.....jerry blimbaum


  • Prev by Date: Re: definite and indefinite Integrate
  • Next by Date: Re: ExpandAll Problem with Rules
  • Previous by thread: Re: Cases
  • Next by thread: Re: Cases