I was expecting it to have some support for virtual functions but that isn’t the case. My first idea was to have some sort of “mod base” class that would provide generic callbacks (on_loaded, on_config_loaded, on_entity_created if defined) and clients simply inherit from that base, define functions they need and call it a day.
Because unclasslib is putting the whole context into the old class however, that’s not possible. It’s virtually impossible for the parent class to access any child data (unless you have passed that at some point, i.e. ParentClass:register(self)).
Even then, I find it somewhat weird that the documentation and the library itself are so out of sync - unless I’m mistaken. One example would be named classes, but class('ClassName') is throwing an error (with class not supporting this behaviour at all from what I can tell) and my_class.__name does not seem to do anything at all. I haven’t read the code myself, but I’m somewhat sure that the doc’s way of calling self.classname isn’t working.
I’m not aware of any - I haven’t really used classes in lua at all so far, with the exception of some smaller things with __index and __newindex. I guess unclasslib is okay if you plan on having just a wrapper for those - but for anything else, especially inheritance, it seems useless.
I’m not sure if I could even come up with a better class implementation, or what I would expect from one in detail. Having dipped in C# area for a bit too long, I’m afraid I would get fancy ideas with abusing __index and __newindex to also allow (virtual) setter/getter properties…