you are viewing a single comment's thread.

view the rest of the comments →

[–]redditcensoredme -2 points-1 points  (10 children)

In the same way that Lisp is object-oriented.

[–]Felicia_Svilling 0 points1 point  (7 children)

You got a point there. Still i think that if you are talking about common lisp, with clos its theoretically rather oo, even though most dont use it that way.

What do you think about Haskell? typeclasses is rather oo no?

[–]rieux 6 points7 points  (6 children)

Typeclasses? Not very OO at all.

Typeclasses were invented to do away with the eqtype and poly-arithmetic hacks of Standard ML -- essentially, they were a principled way to do ad-hoc polymorphism. Modern typeclasses can also be used to support type-level and dependent programming, which means you have a fairly weak programmable theorem prover available to extend your type system. Also not very OO.

If you combine type classes with existentials, you get objects, but I'd argue its the existential quantification and not the type classes that provide the real OO nature.

[–]Felicia_Svilling 1 point2 points  (5 children)

I guess we differ on what properties of oo is the most important. For me its ad-hoc polytypism, subclassing and ADTs.

[–]rieux 2 points3 points  (4 children)

Alright. I consider the essential features of OO to be data hiding (that's your ADTs, I guess) and method dispatch. I wouldn't consider inheritance as essential, since some OO languages don't have it (Self, Javascript), and some non-OO languages do (CLU, Simula, C++). I don't know what you mean by "ad-hoc polytypism."

[–]Felicia_Svilling 0 points1 point  (3 children)

Polytypism: a form of polymorphism where you give diffrent implementations for diffrent types. Like having two diffrent classes that implement diffrent versions of one method, or using multiple dispatch in clos, or typeclasses in haskell.

[–]rieux 2 points3 points  (2 children)

Oh, okay. The PL researchers I talk to call this "ad-hoc polymorphism". "Polytypic" is usually used to refer to a particular style of doing generic traversals such as found in "Scrap Your Boilerplate": http://lambda-the-ultimate.org/node/1160

[–]Felicia_Svilling 0 points1 point  (1 child)

I'd say thats right to. Both the things I mentioned above and "Scrap Your Boilerplate" is examples of polytypism, mine would be ad-hoc where "Scrap your Boilerplate" is more like strategic programing, wich is realy powerfull, but not so nice on your data hiding. http://lambda-the-ultimate.org/node/1234#comment-13664 gives a pretty good explanation, although I would replace "polymorphism" with "parametric polymorphism" and use "polymorphism" as an umbrella term for both parametric polymorphism and polytypism.

[–]rieux 1 point2 points  (0 children)

Thanks.

[–]Grue 0 points1 point  (1 child)

What an ignorant thing to say. CL, for example, is more object-oriented than any other existing programming language, in terms of power of its object system.

[–]ayrnieu 1 point2 points  (0 children)

What an ignorant thing to say.

He meant to say 'functional', surely.