lua-users home
lua-l archive

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


steve donovan <steve.j.donovan@gmail.com> dixit:

> On Tue, Dec 22, 2009 at 7:11 PM, Mark Hamburg <mark@grubmah.com> wrote:
> >(I'm less fond of the trick of having the __index entry in the metatable point back to the metatable. As far as I can see, all this does is save one table in the system and it does so at the expense of making all of the metamethods available for __index access.)
> 
> I see the point (an extra table is nothing here) but why should one
> want to prevent the metamethods from being accessed from the object?
> 

For me it's a semantic/clarity issue -- not a practicle one. What is pointed by __index should hold metamethods -- `e basta! There is certainly no issue to expect at having more stuff there (a whole class-like object, in fact), simply it's confusing. Maybe it's just me.
Once more, metatable complication. For once, I think the design used by python-and-the-like is better, for it's simpler and clearer.

Denis
________________________________

la vita e estrany

http://spir.wikidot.com/