Re: Rule and Module not working together
- To: mathgroup at smc.vnet.net
- Subject: [mg77910] Re: Rule and Module not working together
- From: Steven Siew <stevensiew2 at gmail.com>
- Date: Tue, 19 Jun 2007 06:47:24 -0400 (EDT)
- References: <f55q32$k02$1@smc.vnet.net>
Thanks everyone, It works now with the delay rule In[5]:= myfunc[x_] := Module[{s}, s = {Log[A_] + Log[B_] :> Log[A*B]}; x //. s ] In[6]:= ? myfunc Global`myfunc myfunc[x_] := Module[{s}, s = {Log[A_] + Log[B_] :> Log[A*B]}; x //. s] In[7]:= B = 666; In[8]:= myfunc[Log[f] + Log[g]] Out[8]= Log[f g] In[9]:= myfunc[Log[4] + Log[5]] Out[9]= Log[20]