3 ms·
> you can create an object that implements the same interface and delegates to an instance of the base type (much less readable in every language I've seen, and
by riwsky 13y ago
> you can create an object that implements the same interface and delegates to an instance of the base type (much less readable in every language I've seen, and effectively reimplementing inheritance without the syntactic sugar).
In case you're hankering for a language that makes delegated composition easier, Go's "embedded fields" are sugar for exactly that:
http://golang.org/ref/spec#Struct_types http://golang.org/ref/spec#Struct_types