[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Globals (more ruminations)
- From: Miles Bader <miles@...>
- Date: Fri, 16 Jul 2010 17:35:45 +0900
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.
- References:
- Re: Globals (more ruminations), Mark Hamburg
- Re: Globals (more ruminations), Roberto Ierusalimschy
- Re: Globals (more ruminations), Geoff Leyland
- Re: Globals (more ruminations), Alexander Gladysh
- Re: Globals (more ruminations), Roberto Ierusalimschy
- Re: Globals (more ruminations), Juri Munkki
- Re: Globals (more ruminations), Roberto Ierusalimschy
- Re: Globals (more ruminations), Patrick Donnelly
- Re: Globals (more ruminations), Roberto Ierusalimschy
- Re: Globals (more ruminations), Geoff Leyland
- Re: Globals (more ruminations), Roberto Ierusalimschy
- Re: Globals (more ruminations), Geoff Leyland
- Re: Globals (more ruminations), joao lobato
- Re: Globals (more ruminations), Miles Bader
- Re: Globals (more ruminations), Jonathan Castello