MathGroup Archive 2007

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

Search the Archive

Re: Rule and Module not working together


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]




  • Prev by Date: Re: Combination List
  • Next by Date: Solving a symbolic complex linear system of equation.
  • Previous by thread: Re: Rule and Module not working together
  • Next by thread: Re: Rule and Module not working together