Concatenation-based prototypes implementation for Lua.
- Further Information
$ luarocks --local install families
Through this project root directory:
$ luarocks --local make
Because I already have implemented a library for software composition here, I’m reserving myself to implement just concatenation into this library. Besides, I am free here to focus on concatenative object inheritance and also free to optimize that fast as hell. The current state of this library is simple yet, however. Despite the removal of delegation, it’s planned to provide it in fine-grained & specific ways through a concept known as First-Class Delegation Links.
The API was designed to be simple and minimal. To create an object in this library, we’ll
use the function
clone existing in the
local families = require "families" -- yadda yadda yadda -- local object = families.clone (prototype, structure)
prototype is a previously created object and
structure is where
from its prototype. The
prototype can be
nil, and an alias is provided as well for such
local prototype = families.prototype (structure)
So, the equivalent relations are:
families.prototype (structure) <===> families.clone (nil, structure)
structure is the table which contains the whole definition for
I just want to Clone early and Clone often without the burden of Delegation in the middle of path. Said that, I just want also to leverage the promising prototype-based programming with the whole benefits from concatenative prototypes carried together. This library aims to provide a scalable, fast/efficient and easy to reason prototype-based OO framework. Yet, it will be kept as simple as possible. In the end, it will be easy to learn, to prototype, to debug and to extend (without the fear of breaking things as it occurs on either delegative or class-based world).
For more information, check out our wiki made with love!