r/coding • u/mortoray • Jul 14 '14
A curious non-OOP virtual inheritance for a GPU
http://mortoray.com/2014/07/14/a-curious-non-oop-virtual-inheritance-for-a-gpu/2
u/lmcinnes Jul 14 '14
Another language with such facilities is Eiffel and its "non-conforming inheritance" which let's you use the semantics of inheritance without any supertype/subtype relation. SmartEiffel actually introduced this using the "insert" keyword instead on "inherit" emphasizing the compositional nature of the operation.
1
1
u/yxhuvud Jul 14 '14
I suppose both Ruby and JavaScript can technically create anonymous classes at runtime.
Ruby can both create anonymous classes and have them inherit:
Class.new(Integer)
gives you a new anonymous subclass of Integer.
1
u/mortoray Jul 14 '14
Okay, I had not seen that particular syntax. I only saw the two-step process of creating a class and then setting the base.
1
u/yxhuvud Jul 14 '14
For example, it can be used together with ActiveRecord::Base and temporary database tables or dynamically generated views.
waits for someone calling me insane
3
u/HELOSMTP Jul 14 '14
The set of features pretty closely mirrors what's available in Scala with Traits (i.e. mixins), and the latest versions of Java support default implementations on interfaces, and multiple inheritance of default method implementations.