lua-users home
lua-l archive

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


AdL> You can call that personal taste. Having to explicitly inform the scope
AdL> of the variables I'm reading from/writing to is just an waste of key
AdL> hits. But that's just my point of view, and I'll try to address it with
AdL> setfenv like Adam suggested, at least until I can find another language
AdL> that has most nice features of Lua (maily small size and easy to embed)
AdL> *and* is OO.

I feel this OO business gets way too much attention. Nonetheless, here
we go: I absolutely hate the C++ way of implicit scopes. It may save a
few keypresses when writing it, but it is a nightmare when trying to
understand other peoples code. Plus, it twists the semantics (from
looking at a statement, you can not tell wether any variables
referenced are members of some current object, or variables within the
current scope), and breaks lexical scoping. Looking at this sort of
issues, and also what C++ people do with operator overloading, I tend
to think that they have a knack for puzzles.

I'm all in favor of keeping the "self" notation. And I think that one
OO system to rule them all is not necessarily a boon for lua. As other
people have written, the power of lua comes from the meta-programming,
allowing each user to create an Object (or type. or whatever) system
of their choosing, one that fits their application best. I like how I
can adapt lua to my programming task, instead of the other way round
:-)

btw. I did think of something else I would like: recursive metatable
lookup. That is, metatables can themselves have metatables, with all
the usual semantics (probably except for the arithemtic metamethods,
would not make much sense here).

Gunnar