Named patterns forbidden in Except?
- To: mathgroup at smc.vnet.net
- Subject: [mg110476] Named patterns forbidden in Except?
- From: Carlos CÃsar de AraÃjo <cca at gregosetroianos.mat.br>
- 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 expr, 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. -- Atenciosamente, Carlos CÃ©sar de AraÃºjo Gregos & Troianos Educacional www.gregosetroianos.mat.br Belo Horizonte, MG, Brasil (31) 3283-1122