 
 
 
 
 
 
Re: Pattern matching partial derivatives
- To: mathgroup at smc.vnet.net
- Subject: [mg52402] Re: [mg52372] Pattern matching partial derivatives
- From: "David Park" <djmp at earthlink.net>
- Date: Fri, 26 Nov 2004 01:04:30 -0500 (EST)
- Sender: owner-wri-mathgroup at wolfram.com
Nicolas,
Since
D[f_, x_, Rule[NonConstants, nc_]]
0
you need HoldPattern here.
MatchQ[D[f, x, NonConstants -> {f}], 
  HoldPattern[D[f_, x_, NonConstants -> nc_]]]
True
David Park
djmp at earthlink.net
http://home.earthlink.net/~djmp/ 
From: Nicolas Girard [mailto:nicolas.girard at strasbourg.fr]
To: mathgroup at smc.vnet.net
Hi all,
I can't get finding patterns that would match a simple partial derivative:
Input:
  ?f
  ?x
  D[f, x, NonConstants -> {f}] // FullForm
Output:
  Global`f
  Global`x
  D[f, x, Rule[NonConstants, List[f]]]
Input:
  MatchQ[
    D[f, x, Rule[NonConstants, List[f]]],
    D[f_, x_, Rule[NonConstants, nc_]]
  ]
Output:
  False
Am I damned ?
Many thanks in advance !
Cheers,
Nicolas

