Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #7261 > unrolled thread
| Started by | DrMajorBob <btreat1@austin.rr.com> |
|---|---|
| First post | 2011-12-16 10:57 +0000 |
| Last post | 2011-12-16 10:57 +0000 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.soft-sys.math.mathematica
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: Variables within With statement DrMajorBob <btreat1@austin.rr.com> - 2011-12-16 10:57 +0000
| From | DrMajorBob <btreat1@austin.rr.com> |
|---|---|
| Date | 2011-12-16 10:57 +0000 |
| Subject | Re: Variables within With statement |
| Message-ID | <jcf864$6s6$1@smc.vnet.net> |
It would be nicer, but you can't do it.
Bobby
On Thu, 15 Dec 2011 03:51:48 -0600, Harvey P. Dale <hpd1@nyu.edu> wrote:
> Is there any easy way to have one variable within a With
> statement take its value from a prior variable in the same With
> statement? For example, if I evaluate With[{a = 5, b = 10 a}, a + b], I
> get 5 + 10a, and what I want is 55. I can get there like this: With[{a
> = 5}, With[{b = 10 a}, a + b]] -- which does produce 55 -- but it would
> be nicer if I could use a single With statement and get b, within it, to
> take its value from a.
>
> Thanks.
>
> Harvey
>
--
DrMajorBob@yahoo.com
Back to top | Article view | comp.soft-sys.math.mathematica
csiph-web