MathGroup Archive 2010

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

Search the Archive

Named patterns forbidden in Except?

  • To: mathgroup at
  • Subject: [mg110476] Named patterns forbidden in Except?
  • From: Carlos CÃsar de AraÃjo <cca at>
  • Date: Sun, 20 Jun 2010 03:45:27 -0400 (EDT)

David Bailey wrote:

>>I guess the point is that you could never use the name - because in your

>>example, if x took a value, Except would fail to match by definition! 

Well, this is not a valid argument: I´m not using an isolated Except in a
transformation rule. According to the documentation, "Except[c] is a
pattern object which represents any expression except one that matches c."
In particular, given a pattern patt, we should have, for all expressions

MatchQ[expr, Except[patt]] iff !MatchQ[expr,patt]

But there are (many!) situations where a named patt is useful in
!MatchQ[expr,patt]. Example: my definition of FunctionQ. That definition
works with a named patt in MatchQ, so it should work with Except instead. 

A "Possible Issues" in the documentation would help.


Carlos César de Araújo
Gregos & Troianos Educacional
Belo Horizonte, MG, Brasil
(31) 3283-1122

  • Prev by Date: Re: defining a function of functions
  • Next by Date: Re: defining a function of functions
  • Previous by thread: Re: Setting PageSize and PaperSize
  • Next by thread: Generating Problems