Services & Resources / Wolfram Forums
MathGroup Archive
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2004

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

Search the Archive

Re: Cases

  • To: mathgroup at
  • Subject: [mg50442] Re: [mg50423] Cases
  • From: Andrzej Kozlowski <akoz at>
  • Date: Sat, 4 Sep 2004 01:43:18 -0400 (EDT)
  • References: <>
  • Sender: owner-wri-mathgroup at

*This message was transferred with a trial version of CommuniGate(tm) Pro*
On 3 Sep 2004, at 16:35, Blimbaum, Jerry AA R22 wrote:

> *This message was transferred with a trial version of CommuniGate(tm) 
> Pro*
> 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
This is because Not[d] is not a pattern matched by something that is 
not d. There are several  ways to construct what is effectively such a 
pattern, e.g.





but I don't think there is any way that does not use PatternTest. That 
means that  this is a situation you can make your program simpler if 
you use Select, e.g.



Andrzej Kozlowski
Chiba, Japan

  • References:
    • Cases
      • From: "Blimbaum, Jerry AA R22" <>
  • Prev by Date: Re: ExpandAll Problem with Rules
  • Next by Date: Re : definite and indefinite Integrate
  • Previous by thread: Cases
  • Next by thread: Re: Cases