At 27.11.2009 11:42:11, Julien Danjou <[email protected]> wrote: > 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.
So I can use metatables with __index() in Lua just like with tables? > Code scalability, speed and proficiency. Just that. :) Code scalability? I don't think there's much of a difference... Speed, maybe, thought if I brought that up as an argument I know what would the reply look like ;) Proficiency, as in its a better and cleaner solution? I don't think so, because its tables, not userdata, that is the main datatype in Lua. By circumventing it, you are degrading the language, a lot of its features are primarily designed for tables. > awesome emits signal on property change: > myobj.foo = bar > emits property::foo on myobj. Ok, bad example. I just meant any action that doesn't need to concern the user. > I don't know any limitation; the metatable system is just the same as > table. I think there was at least one other thing that doesn't work with userdata... just can't remember.. Could you throw together a simple example of your userdata-based class system (covering at least the core features if not more)? So that I don't need to spend the weekend figuring it out and can just try it out... :) thanks lukash -- To unsubscribe, send mail to [email protected].
