3 ms·
And maintain type safety?
by bluejekyll 10y ago
And maintain type safety?
- vetinari 10y agoMaybe algebraic data types would be more suitable. In Go, you don't have subclassing, so you cannot implement YourClass<T extends SomeAncestor>.
- stymaar 10y ago> Maybe algebraic data types would be more suitable. There is no opposition between ADT and generics. In fact most language that have ADT have generics… > In Go, you don't have subclassing, so you cannot implement YourClass<T extends SomeAncestor>. There is no link between generics and inheritence, functionnal languages usually don't have OOP mechanism but they still have generics.
- deleted 10y ago[deleted]
- zeveb 10y agoTake a look at CLOS. It's for a dynamically-typed language, but the same principles could be used to provide for multi-methods in a statically-type language like Go.