3 ms·
There are a handful of (somewhat exotic) languages that support multiple dispatch - pretty much, all those listed by you. None of the mainstream ones (C++, Jav
by virgilp 1y ago
There are a handful of (somewhat exotic) languages that support multiple dispatch - pretty much, all those listed by you. None of the mainstream ones (C++, Java, C# etc) do.
(also Common Lisp is hardly a poster child of OOP, at best you can say it's multi-paradigm like Scala)
- pjmlp 1y agoI guess Julia and Clojure are exotic. Since when do OOP languages have to be single paradigm? By then point of view, people should stop complaining about C++ OOP then.
- virgilp 1y ago> Since when do OOP languages have to be single paradigm? What I really meant to say with that was that it's lisp at its core -i.e. if one wants to place it squarely in one single paradigm, imo that one should be "Functional". I was just surprised to see it listed as an example of OOP language, because it's not the most representative one at that.
- pjmlp 1y agoThe Art of Metaobject protocol was written and researched in Lisp. Provides an OOP programming model, that no mainstream language, other than Common Lisp fully supports. https://en.m.wikipedia.org/wiki/The_Art_of_the_Metaobject_Protocol https://en.m.wikipedia.org/wiki/The_Art_of_the_Metaobject_Pr... Dylan, Julia and Clojure only have subsets of it.
- igouy 1y agoMulti-methods do seem like a missed opportunity: "Visitor Pattern Versus Multimethods" https://nice.sourceforge.net/visitor.html https://nice.sourceforge.net/visitor.html
- pjmlp 1y agoAt least we have Julia and Clojure as more mainstream versions of them. Still it isn't CLOS.
- olvy0 1y agoC# does support a form of multiple dispatch, through the dynamic keyword. Used it myself for writing a parser. https://shawnhargreaves.com/blog/visitor-and-multiple-dispatch-via-c-dynamic.html https://shawnhargreaves.com/blog/visitor-and-multiple-dispat...