lua-users home
lua-l archive

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

On Jan 14, 2008 2:39 PM, Jerome Vuarand <> wrote:
> Just use the simplest one until you feel you need more features.

But if Jane writes class X using one model, Joe can't derive class Y
from it using a different model, right? So this does nothing to
ameliorate the problem I was talking about. Doing any OO programming
in Lua represents a commitment to a specific scheme, or the acceptance
that you will have N incompatible object representations in your code.

> C++ has structs, the dot syntax (which ends up being a syntactic sugar
> over C symbols) and virtual method tables. Lua has tables, the colon
> syntactic sugar, and metatables. That's all you need to do OOP.  From
> that you can build progressively more complicated models.

What's your point? I didn't say Lua lacks features needed to implement
OOP. I mentioned C++'s OO implementation only as a counter-example to
the proposition that you *necessarily* had to choose between
performance/simplicity and features.

And again, I wasn't suggesting that Lua *should* have a built-in
object scheme, I was just saying that people pointing out the downside
of this omission are right (and needn't be treated as heretics). The
people pointing out the upside of this omissions are right, too.

> Wouldn't the presence of a built-in OOP model encourage OOP ? Is that
> desirable ? I personnaly prefer Lua as paradigm-agnostic, without
> preventing users to use the paradigm they like.

Huh? Does the presence of built-in closures force people to write
functional designs? Why would having more formalized support for
paradigm X prevent people from using whatever paradigm they prefer?