lua-users home
lua-l archive

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


On Wed, Jan 7, 2009 at 11:28 AM, Mike Panetta <panetta.mike@gmail.com> wrote:
In C++ any reserved 'word' (are +, -, * etc words?) can be overridden. [snip]

I'm pretty sure this isn't true. Don't confuse this with C++ operator overloading - the language provides a specific set of operators, not just any reserved word, which can be overloaded. You can't use C++'s keywords as identifiers, for instance. Try to declare a variable called "return"...

The ability to override the basic operations (keywords) supported by a language is one of the keys to true OOP. 

I don't really follow this point. Not encapsulation, inheritance, and polymorphism?
 
[snip] On the other hand allowing such constructs won't break anything (well at least the table index constructs) so why not allow them?

Lua is designed to provide metamechanisms to implement other programming paradigms. Lua's also got a very carefully pruned design, which I consider one of its top attractions - if you included everything just because "it wouldn't break anything", eventually you're going to end up with a mess of a language.

Evan