[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Using environment for OO
- From: troels knak-nielsen <troelskn@...>
- Date: Fri, 10 Apr 2009 20:18:41 +0200
On Fri, Apr 10, 2009 at 7:24 PM, Martin C. Martin
<martin@martincmartin.com> wrote:
> For an OO style while accessing fields is more common than globals, the
> environment option seems cleaner than the standard : option. Are there any
> down sides that I'm missing?
>
"clean" is such a loaded term.
Obviously, your suggestion makes for an ambiguous syntax. Java doesn't
have this problem, because there is no global scope - only an object
scope. An additional issue in Lua, is that the same function may have
different roles in different situations (Some times as a member
function - some times not). I'm sure this will further complicate
matters/add to the ambiguity.
>From a technical viewpoint, I would venture to guess that it would
bare the cost of an extra lookup, which impacts performance.
--
troels