Re: Visibility of value of variable bindings in module
- To: mathgroup at smc.vnet.net
- Subject: [mg121225] Re: Visibility of value of variable bindings in module
- From: DrMajorBob <btreat1 at austin.rr.com>
- Date: Mon, 5 Sep 2011 07:05:47 -0400 (EDT)
- Delivered-to: l-mathgroup@mail-archive0.wolfram.com
- References: <201109042205.SAA21480@smc.vnet.net>
- Reply-to: drmajorbob at yahoo.com
Values Set in the first argument of Module cannot be used within that List.
That's just the way it is!
Bobby
On Sun, 04 Sep 2011 17:05:15 -0500, caw <cawright.99 at gmail.com> wrote:
> Hi
>
> Module[{x = Sum[i, {i, Length[{1, 2, 3}]}], y = x + 1}, Print[y];
> Print[x]]
>
> prints out:
>
> 1 + x
> 6
>
> So, in the variable declaration section of the Module statement, the
> binding of x to 6 isn't visible to y.
> (It's a bit like let and let*, but not)
>
> Is there a form which will allow the bindings to be visible within the
> variable declaration section?
>
> thanks very much
>
> chris
>
--
DrMajorBob at yahoo.com
- References:
- Visibility of value of variable bindings in module
- From: caw <cawright.99@gmail.com>
- Visibility of value of variable bindings in module