At 1259317921 time_t, [email protected] wrote: > "...it does need to call..." - should have been "doesn't"?
Yeah sure, sorry. > In theory, it could be possible to overload a basic C method by a Lua one... > But its just that you'd need to access a property of a base class through a > subclass. For which you happen to need the __index() method.. You don't need if it's transparent: __index is built by awesome's luaclass system, so it will go see the __index of parent class automagically. That's the beauty and the simplicity of it for people that will use clases. > Also, what is the advantage of having the xxx lines of code to implement > class inheritance with userdata instead of yyy lines of code of allowing > awesome to work with class inheritance as tables? Code scalability, speed and proficiency. Just that. :) > Sometimes you just need to listen to your instincts man :P Its just a feeling > I got while working with it a bit... The main problem is that you can't modify > the metatable. So for example if you want to do an action on setting an > attribute, for example emit a signal, or update an auxiliary list, etc. you > need to use a method and not assignment operator. That may seem petty > to you, but it eventually makes the code (in rc.lua) messier and hard to read. awesome emits signal on property change: myobj.foo = bar emits property::foo on myobj. > Its just one thing, there's probably more, I think you know about the > limitations > of userdata better than me. As usual (unless someone does some proper > investigation) you'll only find out once its a bit too late. I don't know any limitation; the metatable system is just the same as table. -- Julien Danjou // ᐰ <[email protected]> http://julien.danjou.info // 9A0D 5FD9 EB42 22F6 8974 C95C A462 B51E C2FE E5CD // I'm no superman.
signature.asc
Description: Digital signature
