3 ms·
The idea that a type is defined by a set of methods sounds almost exactly like Go...
by AnimalMuppet 12y ago
The idea that a type is defined by a set of methods sounds almost exactly like Go...
- robertknight 12y agoThe more general name for this approach is structural typing - http://en.wikipedia.org/wiki/Structural_type_system http://en.wikipedia.org/wiki/Structural_type_system
- blktiger 12y agoExcept in Go don't you have to define the set of methods in interfaces? In Matz's system the interfaces would be discovered by the interpreter at run-time.
- AnimalMuppet 12y agoIf I understand correctly, yes, in Go you have to define the methods that make up the interface.
- jabbrwcky 12y agoIn Go you define the methods in interfaces but implementors do not have to specify that they implement a given interface. Instead any object (though Go has no real objects) is considered to be an implementation of an interface iff it implements all define methods.
- deleted 12y ago[deleted]