MathGroup Archive 2011

[Date Index] [Thread Index] [Author Index]

Search the Archive

Visibility of value of variable bindings in module


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




  • Prev by Date: Unprotect a built-in operator
  • Next by Date: JLink connection at Mathematica 8 start on OS X 10.6
  • Previous by thread: Unprotect a built-in operator
  • Next by thread: Re: Visibility of value of variable bindings in module