- OO like in Smalltalk
- OO like in SELF
- OO like in BETA
- OO like in CLOS
- OO like in COM
- OO like in Haskell
- OO like in C++
- OO like in Eiffel
- OO like in Ada
- OO like in Sather
A few more models might exist.
In regards to Scala, I would say OCaml has similar capabilities.
Yes, it has a bit of everything anyone thought about in FP in it.
However you can make use of traits like feature by mixing in modules and objects, while taking advantage of first class modules in OCaml.
> JavaScript has many influences beyond Self
Sure, but I am unaware of any that make it such a great language.
JavaScript has been very successful, and got a whole generation of programmers playing around with prototypes without knowing it.
JavaScript's success has less to do with how good the language is, rather sharing the same fate as successful systems programming languages, by being the only gate to the kingdom.
OO in OCaml feels as if the designers thought "we think OO sucks, so let's implement terrible support for OO to get our point across".
Please explain. Are you referring to type classes?
Wikipedia at least seems to agree with me.
For example, OOP with multi-methods, does not imply such encapsulation.
There is a lot of disagreement about which of those is more important. For me polymorphism is the most important, encapsulation is useful sometimes, and inheritance might be a negative attribute. For you encapsulation.
FP is smaller and stricter, it's almost formally defined (you have denotational semantics for FP VM for what it's worth).
So you just get ADTs as introduced by Mesa/Modula-2.
So, polymorphism and object-orientation are orthogonal concerns. OOP is about encapsulation, inheritance, and modules that couple mutable state (attributes) and behavior (methods).
Which is still polymorphism. I purposely did not enumerate all CS forms of polymorphism, but can get more detailed if you will.