lua-users home
lua-l archive

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


On Dec 22, 2009, at 11:25 AM, Javier Guerra wrote:

> On Tue, Dec 22, 2009 at 2:16 PM, spir <denis.spir@free.fr> wrote:
>> Again: why aren't metamethods identified by name?
> 
> you keep repeating this; but i really don't get what you mean.  either
> you defined your request somewhere else and i missed it, or you think
> it's too obvious to state.  but i _really_ don't have the faintest
> idea what this could mean.

I think what Denis is asking is why we can't just do things like put __tostring in the object/table itself and instead we have to put it in the metatable.

That would certainly make one-off object creation easier. I don't know what the performance impact would be in general and I don't know what the other considerations were that led to the current design.

Mark