Re: Transformation rule exercise
- To: mathgroup at smc.vnet.net
- Subject: [mg4940] Re: [mg4898] Transformation rule exercise
- From: Xah Lee <xah at best.com>
- Date: Mon, 7 Oct 1996 02:02:11 -0400
- Organization: Best Internet Communications
- Sender: owner-wri-mathgroup at wolfram.com
> Date: Fri, 4 Oct 1996 00:17:36 -0400 > From: rhall2 at umbc.edu (hall robert) To: mathgroup at smc.vnet.net > To: mathgroup at smc.vnet.net > Subject: [mg4898] Transformation rule exercise > ... exercise 4 from p. 113 of > Introduction to Programming with Mathematica, by Gaylord, Kamin & Wellin. > The problem is to rewrite > g[x_] = x /. Plus[z___] -> Times[z] > so that > g[a + b + c] > returns > a b c >... > I'm looking for a solution to which the > authors' hint applies... I'm not sure what if the following is what you are looking for. g[x_] := ReleaseHold[ Hold[ Plus[3,4,5] ] /. Plus->Times] Xah xah at best.com; 74631.731 at compuserve.com http://www.best.com/~xah/SpecialPlaneCurves_dir/specialPlaneCurves.html Mountain View, CA, USA