lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Wed, 19 Dec 2001, Reuben Thomas,,,690081 wrote:

> I'd be interested to know what you (or anyone else) thought of my proposal
> on this subject (which was to make variables local by default); the
> proposal is also on the Wiki, to save readers trawling through the archives.
>
> I've heard from the Lua team that it was received and read, but no opinions
> on the details.
>
> Since it seems in line with the move to make global variables not special
> (in particular, thinking of tables as a series of nested scopes, it's
> natural to default to the innermost scope when defining a new variable),
> perhaps it's worth looking at, at least as a straw man or Aunt Sally (I
> haven't seen any other proposals yet which meet the same criteria
> of minimality, backwards compatibility, and allowing config files
> to be written in the current way).

I did not understand how your proposal keeps backwards compatibility. Also,
I think local by default give very strange results; but this is a matter of
taste... Anyway, I think the main problem is not what is the default, but
any default: if you want good check, you need a way to prevent implicit
(default) declarations, no matter whether they are global or local.

-- Roberto