The Math Forum

Search All of the Math Forum:

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

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

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

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 ]

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]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.