Re: Table local
- To: mathgroup at smc.vnet.net
- Subject: [mg113814] Re: Table local
- From: Bill Rowe <readnews at sbcglobal.net>
- Date: Sun, 14 Nov 2010 06:08:38 -0500 (EST)
On 11/13/10 at 12:58 AM, he.frauendorfer at t-online.de (EF) wrote:
>"Help, More Information" for Table states:
>Table effectively uses Block to localize values or variables.
>But Clear[u]; Table[u = i^2, {i, 5}]; u
>Clear[u]; Table[u = i^2;, {i, 5}]; u
>In both cases the value 25 for u is given. If u were really local,
>it should have no value outside of the Table
>For me there is a contradiction that can cause a lot of trouble
In Table[u = i^2, {i, 5}], it is i that is localized, not u. Do
Clear[u]
then enter Table[u = i^2, {i, 5}]
into a new cell and notice the colors of the variables. You will
find u has the color of a symbol with no assigned value and i
has the color of a local variable. Syntax coloring can tell you
a lot if you notice.