```Date: Apr 12, 2013 2:15 AM
Author: David Park
Subject: Re: "Programming With Mathematica" Exercise help

Hold[(z = 11; a = 9; z + 3)] /. z -> aReleaseHold[%] Hold[a = 11; a = 9; a + 3] 12David Parkdjmpark@comcast.net http://home.comcast.net/~djmpark/index.html From: plank.in.sequim@gmail.com [mailto:plank.in.sequim@gmail.com] I'm loving Paul Wellin's book "Programming with Mathematica: AnIntroduction" and am trying to diligently do all the exercises.  Most ofthem have answers in the back but I'm stuck on Section 4.2, Exercise 2 andthere's no answer given.  It gives the following Mathematica code:z = 11;a = 9;z + 3 /. z -> a14So "z+3" is being evaluated to 14 and then the substitution has no effect.He asks how to "use the Hold function in the compound expression to obtain avalue of 12".  I don't seem to be able to get this to work.  My originalthought was to hold z+3, but then the z in the replacement part getsevaluated so the replacement is actually 11->3 which doesn't match in theheld z+3 expression.  In fact, if you replace "z+3" with Hold[11+3] thenyou'll end up with Hold[9+3].  Curiously, this works differently if you usereplace.In:  Replace[Hold[11+3],11->9]Out: Replace[Hold[11+3],11->9]In:  Hold[11+3]/.11->9out: Hold[9+3]I thought these two were supposed to be equivalent so I'm a bit confusedhere.In any event, I've tried all the commonsense ideas I've had and then spentsome time flailing about randomly with Hold's but nothing seems to workcorrectly.  Can anybody help me understand this?  Thanks!Darrell
```