Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #7401
| From | markholtuk <markholtuk@googlemail.com> |
|---|---|
| Newsgroups | comp.soft-sys.math.mathematica |
| Subject | Re: Variables within With statement |
| Date | 2011-12-22 09:26 +0000 |
| Organization | Steven M. Christensen and Associates, Inc and MathTensor, Inc. |
| Message-ID | <jcut3j$dg4$1@smc.vnet.net> (permalink) |
| References | <jccg39$mb4$1@smc.vnet.net> <jchh07$i99$1@smc.vnet.net> <jcpfr4$qi3$1@smc.vnet.net> |
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!
Back to comp.soft-sys.math.mathematica | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Variables within With statement "Harvey P. Dale" <hpd1@nyu.edu> - 2011-12-15 09:53 +0000
Re: Variables within With statement Simon <simonjtyler@gmail.com> - 2011-12-16 11:07 +0000
Re: Variables within With statement markholtuk <markholtuk@googlemail.com> - 2011-12-17 07:39 +0000
Re: Variables within With statement Szabolcs <szhorvat@gmail.com> - 2011-12-20 08:09 +0000
Re: Variables within With statement markholtuk <markholtuk@googlemail.com> - 2011-12-22 09:26 +0000
Re: Variables within With statement "Alexander Elkins" <alexander_elkins@hotmail.com> - 2011-12-17 07:49 +0000
csiph-web