Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2007
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2007

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

Search the Archive

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]




  • 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