at:tutorial:objects
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | Next revisionBoth sides next revision | ||
at:tutorial:objects [2007/06/29 14:24] – jorge | at:tutorial:objects [2007/06/29 14:31] – jorge | ||
---|---|---|---|
Line 75: | Line 75: | ||
===== Delegation and dynamic inheritance ===== | ===== Delegation and dynamic inheritance ===== | ||
- | The parent of an object is bound to a field named '' | + | The parent of an object is bound to a field named '' |
+ | |||
+ | < | ||
+ | > def OpenConnection := object: {...}; | ||
+ | def ClosedConnection := object: {...}; | ||
+ | def Connection := object: { | ||
+ | def open() { | ||
+ | super := OpenConnection.new(); | ||
+ | }; | ||
+ | def close() { | ||
+ | super := ClosedConnection.new(); | ||
+ | }; | ||
+ | } | ||
+ | </ | ||
===== First-class Delegation ===== | ===== First-class Delegation ===== |
at/tutorial/objects.txt · Last modified: 2013/05/17 20:23 by tvcutsem