Re: PatternMatching with Dt[]

*To*: mathgroup at smc.vnet.net*Subject*: [mg37294] Re: [mg37264] PatternMatching with Dt[]*From*: Andrzej Kozlowski <andrzej at tuins.ac.jp>*Date*: Tue, 22 Oct 2002 04:47:17 -0400 (EDT)*Sender*: owner-wri-mathgroup at wolfram.com

The correct function to use is (as the name suggests) HoldPattern: In[76]:= Dt[x]/.HoldPattern[Dt[arg_]]:>f[arg] Out[76]= f[x] Andrzej Kozlowski Yokohama, Japan http://www.mimuw.edu.pl/~akoz/ http://platon.c.u-tokyo.ac.jp/andrzej/ On Monday, October 21, 2002, at 03:29 PM, Johannes Ludsteck wrote: > I would like to replace Dt[x_] in a complex > expression. For example consider > > Dt[x]/.Dt[arg_]->f[arg] > > where x is a pure Symbol (has no value). > However, Mathematica refuses apply the rule. > Various other attempts, for example > Unevaluted[Dt[arg_]]:>f[arg] > and HoldForm[...] were unsuccessful. > > I managed to circumvent the problem by > Dt[x]/.Dt->fun > However, I were more happy if I understood why the > first attempt was not successful. > Can someone explain? > > Best regards, > Johannes Ludsteck > <><><><><><><><><><><><> > Johannes Ludsteck > Economics Department > University of Regensburg > Universitaetsstrasse 31 > 93053 Regensburg > Phone +49/0941/943-2741 > > > >