Inheritance/Multiple: Difference between revisions
Content added Content deleted
No edit summary |
(added Io entry) |
||
Line 477: | Line 477: | ||
end</lang> |
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}}== |
=={{header|Ioke}}== |
||
<lang ioke>Camera = Origin mimic |
<lang ioke>Camera = Origin mimic |