Class Inheritance as a cyclic graph
This is a highly speculative idea.
Lately, I’ve been dreaming of a system where inheritance would be extremely general. None of this hierarchical nonsense. I’m looking for something with more flexibility. I’m looking for dynamic binding, done as late as possible, along a directed graph. I’d like to allow for the possibility of cycles in this graph, which’ll probably throw a wrench in the works. We already have mechanisms for detecting cycles, and by marrying these with a yet-to-be-defined cannonical method resolution order that preserves the local preference ordering and monotonicity even in the face of cycles.
Even more outlandish is a recursive definition for a class, that is, a class that inherits itself. I have no idea where this might be useful, for I have not yet inundated myself with the dark literature surrounding mind-warping meta-programming. I also do not know how this might affect typing systems and substitutability.
Hopefully soon, I’ll be able to resolve some of these important issues, but for now I unleash the idea that inheritance and method resolution can be implement via a walk along a directed graph, possibly cyclic. At any rate, I’m gonna have to start teaching myself graph theory.