|
|
|
|
|
by hellofunk
3878 days ago
|
|
But protocols and mulitmethods are different from OO in the sense that the functions are decoupled from the state. You don't store state in a protocol, you just define an interface. That's pretty different from the way most people think about OO in c++, java, swift, objective-c, etc. In Clojure, you have Records and maps, which hold your "state" or your values, and you have protocols which define your functions, and the two are isolated from each other and not attached in any way. That's quite different from OO in general, don't you think? |
|
Just go read the Xerox PARC papers on how to do OO in Lisp, for example.
Back when OO was new there were multiple ways of how to do OO.
Some languages used the Smalltalk approach.
Others took the Simula approach where objects were an evolution of modules that could be extend and manipulated.
And there were lots of other options scattered around OOPSLA papers.
What happens is that there are now a couple of generations of new developers that didn't live through the procedural to object oriented programming revolution, nor were doing their CS degree in those days, so many understand OO as C++, Java et al do it and think no other way is possible.
The way Lisp does it, is quite common in the OO languages that offer multi-dispatch in method binding.
Since all method arguments types are used in the method resolution, it doesn't make sense to bind the methods to a specific object.
LOOPS and CLOS books/papers are pretty clear that they are doing OOP.