MathGroup Archive 2009

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

Search the Archive

Re: Picking Off Lists That Have No Numbers

  • To: mathgroup at smc.vnet.net
  • Subject: [mg99521] Re: Picking Off Lists That Have No Numbers
  • From: yatesd at mac.com
  • Date: Thu, 7 May 2009 06:34:45 -0400 (EDT)
  • References: <gtrl29$1o5$1@smc.vnet.net>

Here is my understanding of what is going on. In your examples, you
are testing for pattern matches with one of the following forms:
_Real, _Rational, _String, or _Number. Real, Rational, and String are
all valid "Heads". (See help for function Head if you are not familiar
with them). Number is not a head. Numbers either have head Real,
Rational, Integer, or Complex (as far as I know). The expression
Number seems to be only used in relation to importing with the Read
function. There is however a FUNCTION NumberQ. So you could create a
pattern of the form _?NumberQ (note the important '?' in the
expression). Using that instead of _Number should give you the results
you expect. _?NumericQ gives similar results, but will treat numbers
like pi and e as being numbers too.

Hope that helps,

Derek Yates



  • Prev by Date: Re: Re: programmatically rotating a function plot
  • Next by Date: Re: Function parameter passing?
  • Previous by thread: Re: Picking Off Lists That Have No Numbers
  • Next by thread: Re: Picking Off Lists That Have No Numbers