loading...

re: What the heck is polymorphism? VIEW POST

TOP OF THREAD FULL DISCUSSION
re: Us grey beards call that a union :-) geeksforgeeks.org/difference-struc...
 

Not quite. It's implemented as a tagged union, but the power comes from building a full algebra that makes type composition trivial and very easy to reason about (thus the phrase "algebraic data type"). Their history goes back to the 1970's, so they're not much younger than C and they're older than object oriented programming.

 

"Their history goes back to the 1970's, so they're [...] older than object oriented programming."

Errr... Object oriented programming dates back to Simula 67, released in 1967 (or even further -- you can do OOP without language support, as long as your language supports indirect function calls, and there are anecdotal stories of people creating objects in assembly language all the way back to the 50s).

Code of Conduct Report abuse