MathGroup Archive 1995

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

Search the Archive

(x...) only works when x == _

  • To: mathgroup at
  • Subject: [mg433] (x...) only works when x == _
  • From: perkins at (Tyler Perkins)
  • Date: Fri, 27 Jan 1995 15:54:07 -0700

Here is some odd fundamental behavior that appears to be a bug.

According to the Book, the form "RepeatedNull[x]" should match zero or more
occurances of "x", whether or not x is a pattern object.  Nope!


Yet it works when is x is the pattern "_":

  MatchQ[{}, {_...}]

OK, so let's change "x" into a pattern object:


Hmmm.  That didn't work either.  The only way I've found to get what I want
is to use the pattern "((s1:_) /; s1 == x)" instead of just "x":

  MatchQ[{},{((s1:_) /; s1 == x)...}]

So why doesn't MatchQ[{},{x...}] ?

        Tyler Perkins                   perkins at

  • Prev by Date: MultipleLogListPlot
  • Next by Date: goto-do-label
  • Previous by thread: MultipleLogListPlot
  • Next by thread: goto-do-label