We could extend sclang's flexibilty considerably if we'd added AbstractObject, a superclass for Object. This class would only support a minimal interface of methods (mainly for introspection). This would follow the idea of Ruby's BasicObject.
By default, all classes would still inherit from Object. By inheriting from AbstractObject, it would be possible to build alternative behaviours for objects which are not currently possible.
The most immediate practical impact would be that we could make Object prototyping safe (currently, pseudo-methods may be overridden later by a class extension of any class above Event).
I have written number of experimental classes with a similar approach, which is to be found here: https://github.com/telephon/Neutral
The current inheritance scheme:
Object ––superclass–> nil
Meta_Object ––superclass–> Class
The new inheritance scheme would be:
Object ––superclass–> AbstractObject ––superclass–> nil
Meta_Object ––superclass–> Meta_AbstractObject ––superclass–> Class
Side Note: a primitive for directly forwarding a method call to a different receiver unchanged would make the implementation very efficient, and could make it an alternative to method extensions.
(was: #1831)
We could extend sclang's flexibilty considerably if we'd added
AbstractObject, a superclass forObject. This class would only support a minimal interface of methods (mainly for introspection). This would follow the idea of Ruby's BasicObject.By default, all classes would still inherit from
Object. By inheriting fromAbstractObject, it would be possible to build alternative behaviours for objects which are not currently possible.The most immediate practical impact would be that we could make Object prototyping safe (currently, pseudo-methods may be overridden later by a class extension of any class above
Event).I have written number of experimental classes with a similar approach, which is to be found here: https://github.com/telephon/Neutral
The current inheritance scheme:
Object ––superclass–> nilMeta_Object ––superclass–> ClassThe new inheritance scheme would be:
Object ––superclass–> AbstractObject ––superclass–> nilMeta_Object ––superclass–> Meta_AbstractObject ––superclass–> ClassSide Note: a primitive for directly forwarding a method call to a different receiver unchanged would make the implementation very efficient, and could make it an alternative to method extensions.
(was: #1831)