O_o
You know, again not trying to harsh your buzz*, you seemingly lack a way to do spontaneous inheritance despite the fact that your "Class-C" "OOP" is somewhere around "mixins"/"monkey patching".
Consider:
Code:
Person
{
void eat(){/*...*/}
void move(){/*...*/}
void talk(string * s)
{
printf("%s", s);
}
}
Singer:Person
{
void sing(){/*...*/}
}
Okay. We are good so far as it goes, but what do we do for `Dancers'?
If we follow the mechanic, as exists in the examples, we need to create two new classes to cover the spread:
Code:
Dancer:Person
{
void dance(){/*...*/}
}
Dancer:Singer:Person
{
void dance(){/*...*/}
}
The situation quickly grows into nightmares. Many strategies exist to solve such problems for C, C++, Java, and so on for many languages, but breaking with traditional inheritance as you have allows the compiler to "mix" the "classes" on the fly:
Code:
Person
{
void eat(){/*...*/}
void move(){/*...*/}
void talk(string * s)
{
printf("%s", s);
}
}
Singer /* patch: adds `sing' method */
{
void sing(){/*...*/}
}
Dancer /* patch: adds `sing' method */
{
void dance(){/*...*/}
}
Which might still be created, as if written similar to the previous thoughts, with a general syntax such as:
Code:
int main()
{
Dancer:Singer:Person * s = Dancer:Singer:Person:alloc();
}
*shrug*
Of course, this is "unnecessary", "complicated", and "big" in exactly the same way as C++, Java, and such provide competing mechanisms.
Soma
*): My first attempts were abysmal.