At 27.11.2009 10:18:42, Julien Danjou <[email protected]> wrote: > There's a way, but I don't see why we would need it. > awesome just knows about its basic objects, it does need to call any > other method that you may have added to the basic class, or to a > subclass of a basic class.
"...it does need to call..." - should have been "doesn't"? 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.. 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? > > The userdata is just really awkward to work with in Lua, you'll end up > > needing to implement this and that in C to get what you need in Lua... > > Well, no offense, but that's more than a feeling that any objective > point. You need to bring fact ang real arguments or criticize something > that is currently done in awesome, rather than "it's awkward". :) 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. 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've thought about having modules too, but maybe its not needed, and > > maybe it could case problems... some parts of the config are (or could > > be for some users) interconnected. It could cause problems too. > > Again, you need real arguments and/or examples. Maybe I'll have a look at it, I don't know atm. It would also depend on how you well split the modules. Maybe when you try it, you may find out already its not good... dunno. cheers lukash -- To unsubscribe, send mail to [email protected].
