lua-users home
lua-l archive

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


John Hind skrev:
[...]
Of course, if you want it to be in an outer scope, you have to pre-declare in that scope.
Which is a mess, and you'll mix up stuff when to predeclare and when not to, and might as
well end up always predeclaring, and hey, we're back were we started.


I prefer it the way it is, simply because:
1. It works
2. Don't fix something that works
3. If it doesn't work in a special case, I can easily change it


and what you say about polluting the global namespace[1], a perfect solution is to replace the environment with an empty table - so all global-by-default values will end up there. In other words, using the `module' function is acutally an excellent way to rid the global-by-default issue, as I see it (which might be wrong for you, because I never really got what it is you see as "the wrong thing"
actually being wrong).

It's just my 2 cents of support to keeping it as it is, which I'm assured of it will.


//Andreas

[1] http://lua-users.org/lists/lua-l/2006-10/msg00067.html