lua-users home
lua-l archive

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


Jonathan Castello <twisolar@gmail.com> writes:
>> The implementation suggested by Roberto looks quite useful, is optional,
>> and would be off by default for backward compatibility.  So what's the
>> problem, exactly?
>
> IMHO it's kind of ugly/clunky and feels like a band-aid to me, but I
> mainly just use Lua embedded within a host application, so I could be
> missing something. When I write small utility libraries, I pretty much
> create my own "environment" table and return that from the chunk. My
> feeling is that it would be simplest if this were the default, and
> everything within a chunk was always executed within a new
> environment. Then I wouldn't have to worry about accidentally
> cluttering the calling code's space at all.

I don't know that the problem is so much one of "cluttering the calling
code's space", but more of "catching programming errors."

That, AFAIK, is the main reason people don't like Lua's traditional
behavior -- it lets mistakes in variable names slip by unnoticed.

-Miles

-- 
Cannon, n. An instrument employed in the rectification of national boundaries.