MathGroup Archive 1998

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

Search the Archive

Inconsistencies in pattern matching.

  • To: mathgroup at
  • Subject: [mg12937] Inconsistencies in pattern matching.
  • From: Sean Ross <seanross at>
  • Date: Wed, 24 Jun 1998 03:44:55 -0400
  • Sender: owner-wri-mathgroup at

This is an example taken from Ken Wagners Power Programming book:





As long as the list of {x,y} data points has one point or greater than
two points, it transforms as one would expect.  If there are  two {x,y}
data points, it transforms differently.



Now, if x_ is seen to match {x1,y1} in example 3, then why doesn't it
also match it in example number 1 and 2?  This behavior can be fixed
with a /;Head[x]=!=List  pattern restricting rule, but that is not the
point.  This seems grossly inconsistent to me.  Can anyone explain why
it does this and/or justify that this is a good thing?

  • Prev by Date: Re: How to plot list of items {x,y} where x is a scalar and y is an array.
  • Next by Date: Re: plotting {x,y} data where y is a array and x a scalar ??
  • Previous by thread: Re: Piecewise defined functions
  • Next by thread: Re: Inconsistencies in pattern matching.