2 ms·
The wikipedia page lists three types of polymorphism. Duck typing is linked in the page as another kind of polymorphism. I've seen several other types in the wi
by humanrebar 10y ago
The wikipedia page lists three types of polymorphism. Duck typing is linked in the page as another kind of polymorphism. I've seen several other types in the wild, such as link-time polymorphism.
https://en.wikipedia.org/wiki/Polymorphism_(computer_science) https://en.wikipedia.org/wiki/Polymorphism_(computer_science...
The general idea is that you can have one expression dispatch to many different concrete implementations depending on the context. Virtual function calls is one approach, but C uses function pointers, C++ uses templates, dynamic languages use duck typing, several languages use message passing, and so on.