lua-users home
lua-l archive

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

> I think that monkeypatching [1]
> is wrong, and I will try to disuade people from  > doing it ("play stupid
> games" and all that), but I do admit that it is > > sometimes desirable to do
> [2] and won't try to make it impossible...

I think that metatables being open to extension is fine if you namespace the keys (for example __module_mycustomkey or whatever). It enables a kind of ad-hoc polymorphism for user defined functions which I quite like. I think with some cleverness around __metatable one could protect themselves from clobbering of built in keys and still have this functionality too.