MathGroup Archive 2013

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

Search the Archive

Re: "Programming With Mathematica" Exercise help

  • To: mathgroup at smc.vnet.net
  • Subject: [mg130472] Re: "Programming With Mathematica" Exercise help
  • From: plank.in.sequim at gmail.com
  • Date: Sat, 13 Apr 2013 20:36:54 -0400 (EDT)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • Delivered-to: l-mathgroup@wolfram.com
  • Delivered-to: mathgroup-newout@smc.vnet.net
  • Delivered-to: mathgroup-newsend@smc.vnet.net
  • References: <kk5r6r$ric$1@smc.vnet.net> <kk88ru$c1p$1@smc.vnet.net>

> Hold[z + 3] /. HoldPattern[z] -> a
> % // ReleaseHold

I would have thought this was the closest to what I would have called a "correct" answer since it actually uses hold and all the variables have their assigned values when the replacement takes place.  I really think the most elegant way of doing it is the Unevaluated answer and the one that uses Block but neither uses Hold.  Thanks - I guess HoldPattern is probably the magic I was looking for.



  • Prev by Date: Re: "Programming With Mathematica" Exercise help
  • Next by Date: Re: "Programming With Mathematica" Exercise help
  • Previous by thread: Re: "Programming With Mathematica" Exercise help
  • Next by thread: Re: "Programming With Mathematica" Exercise help