Remix.run Logo
pjmlp 5 days ago

There are OOP languages that use doThing(X, Y), though.

Ada, Julia, Dylan, Common Lisp for example.

Yet another example why people shouldn't put programming paradigms all into the same basket.

virgilp 5 days ago | parent | next [-]

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)

olvy0 4 days ago | parent | next [-]

C# 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-dispat...

pjmlp 5 days ago | parent | prev | next [-]

I 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 4 days ago | parent [-]

> 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 4 days ago | parent [-]

The 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_Pr...

Dylan, Julia and Clojure only have subsets of it.

igouy 5 days ago | parent | prev [-]

Multi-methods do seem like a missed opportunity:

"Visitor Pattern Versus Multimethods"

https://nice.sourceforge.net/visitor.html

pjmlp 4 days ago | parent [-]

At least we have Julia and Clojure as more mainstream versions of them.

Still it isn't CLOS.

saghm 5 days ago | parent | prev [-]

Yeah, the dot operator is not a particularly strong signal of whether something is OOP or not. You could change the syntax of method calls in OO languages to not use the object as a prefix without the underlying paradigm being affected.