For those Lua OOP aficionados, I recently released a new version of
lua_objects which, among other things, now includes support for:
* class mixins
Check out lua_objects @ github for more info.
These changes were inspired from continuing work on my Lua port of the WAMP Protocol library for Corona SDK. That project contains a lot of Python code and it has reminded me how much I like the Python language. 🙂 Some particular things I re-discovered this time around were 1. method / class decorators and 2. multiple inheritance (including mixins).
That got me working on how to bring some of these aspects to Lua when doing OOP.
After the update, I was able to move the existing Event code (add/remove listener, etc) from the
lua_objects core into its own module
lua_events_mix.lua. Now that Event code can be easily re-used by other projects, either as a mixin or as a (monkey) patch.
Have fun !
- lua_objects: https://github.com/dmccuskey/lua-objects
- WAMP Protocol: http://wamp.ws/