Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.math.mathematica

Topic: "Programming With Mathematica" Exercise help
Replies: 10   Last Post: Apr 13, 2013 8:36 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
plank.in.sequim@gmail.com

Posts: 7
Registered: 4/11/13
Re: "Programming With Mathematica" Exercise help
Posted: Apr 13, 2013 8:36 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

> 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.




Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.