Services & Resources / Wolfram Forums
MathGroup Archive
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 1995

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

Search the Archive

Re: Logical inconsistency

  • To: mathgroup at
  • Subject: [mg1246] Re: Logical inconsistency
  • From: beretta at ATHENA.MIT.EDU (Robert K Beretta)
  • Date: Fri, 26 May 1995 06:30:18 -0400
  • Organization: Massachusetts Institute of Technology

In article <3q14ct$725 at> jorma.virtamo at
(Jorma Virtamo) writes in part:
>The other day I tried to construct a rule that applies
>to patterns of type 
>  test = h[a] + h[1] + h[anything];
>i.e. a sum of functions with head h. The most natural thing
>to do is to define the general pattern by
>  patt = Plus[__h];
>However, when you check for the match, you find to your surprise:
>  MatchQ[test,patt]
>  False

Although there are several work-arounds, as you have shown, the _Literal_
head is specifically intended to deal with this issue.  For example:

     test = h[a] + h[1] + h[anything];

     patt = Literal[ Plus[__h] ]




Hope this helps.

Bob Beretta
beretta at

  • Prev by Date: brackets and braces in frontend with german DEC-keyboard
  • Next by Date: Graphic Bugs: Large circle
  • Previous by thread: Logical inconsistency
  • Next by thread: Re: Logical inconsistency