Abstract type: Difference between revisions
Content added Content deleted
No edit summary |
(added abstract type example for AmigaE) |
||
Line 189: | Line 189: | ||
operator -> (stream, isout) |
operator -> (stream, isout) |
||
}</lang> |
}</lang> |
||
=={{header|AmigaE}}== |
|||
In AmigaE, abstract methods are supported but interfaces are not. |
|||
<lang amigae> |
|||
OBJECT fruit |
|||
ENDOBJECT |
|||
PROC color OF fruit IS EMPTY |
|||
OBJECT apple OF fruit |
|||
ENDOBJECT |
|||
PROC color OF apple IS WriteF('red ') |
|||
OBJECT orange OF fruit |
|||
ENDOBJECT |
|||
PROC color OF orange IS WriteF('orange ') |
|||
PROC main() |
|||
DEF a:PTR TO apple,o:PTR TO orange,x:PTR TO fruit |
|||
FORALL({x},[NEW a, NEW o],`x.color()) |
|||
ENDPROC |
|||
</lang> |
|||
prints to the console: |
|||
red orange |
|||
=={{header|Argile}}== |
=={{header|Argile}}== |