Inheritance/Multiple: Difference between revisions

Latitude language added
(Rename Perl 6 -> Raku, alphabetize, minor clean-up)
(Latitude language added)
Line 811:
 
true
 
=={{header|Latitude}}==
 
Latitude is a prototype-oriented language, and every object can have only one prototype. As such, multiple inheritance in the usual sense is impossible in Latitude. The behavior of multiple (implementation) inheritance can be approximated with mixins.
 
<lang latitude>Camera ::= Mixin clone.
MobilePhone ::= Mixin clone.
 
CameraPhone ::= Object clone.
Camera inject: CameraPhone.
MobilePhone inject: CameraPhone.</lang>
 
In order to add functionality to either of the mixins, the <code>interface</code> slot of the mixin must be modified to include the name of the new method. Injecting a mixin makes a copy of the methods, as opposed to traditional (prototype) inheritance in which method calls are delegated.
 
=={{header|Lingo}}==
37

edits