Anonymous user
Inheritance/Multiple: Difference between revisions
added Io entry
No edit summary |
(added Io entry) |
||
Line 477:
end</lang>
=={{header|Io}}==
<lang Io>Camera := Object clone
Camera click := method("Taking snapshot" println)
MobilePhone := Object clone
MobilePhone call := method("Calling home" println)
CameraPhone := Camera clone
CameraPhone appendProto(MobilePhone)
myPhone := CameraPhone clone
myPhone click // --> "Taking snapshot"
myPhone call // --> "Calling home"</lang>
In Io each object has an internal list of prototype objects it inherits from. You can add to this list with <code>appendProto</code>.
=={{header|Ioke}}==
<lang ioke>Camera = Origin mimic
|