3 ms·
Wikipedia has something interesting on this (how unions can be implemented using "class hierarchy in object-oriented programming"): https://en.wikipedia.org/wi
by drycabinet 2y ago
Wikipedia has something interesting on this (how unions can be implemented using "class hierarchy in object-oriented programming"):
https://en.wikipedia.org/wiki/Tagged_union#Class_hierarchies_as_tagged_unions https://en.wikipedia.org/wiki/Tagged_union#Class_hierarchies...
There is a lengthy blog post about the same stuff, except that the author doesn't seem to have come across the said wiki section yet:
https://nandakumar.org/blog/2023/12/paradigms-in-disguise.html https://nandakumar.org/blog/2023/12/paradigms-in-disguise.ht...
Kudos to the dev of datatype99 for showing the problem with such ad-hoc methods in the readme right away.
- alpine32 2y ago[dead]