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: Variables within With statement
Replies: 5   Last Post: Dec 22, 2011 4:01 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]

Posts: 17
Registered: 6/27/07
Re: Variables within With statement
Posted: Dec 22, 2011 4:01 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

On Dec 20, 8:09 am, Szabolcs <szhor...@gmail.com> wrote:
> On Saturday, 17 December 2011 08:39:51 UTC+1, markholtuk wrote:
> > You could try delaying assignment of a, as follows:
> > In[1]:= With[{a := a = 5, b = 10 a}, a + b]
> > Out[1]= 55
> Please note that this solution modifies the global variable 'a', and therefore defeats the purpose of With (which is defining *local* constants).

Indeed. Apologies for this. The Christmas run-up appears to be having
its usual effect on my IQ!

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

[Privacy Policy] [Terms of Use]

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