Re:Where FP meets OO
by Denommus on Tuesday December 30, 2014 @09:38AM
(#8814715)
Besides the object system, OCaml has a powerful module system, with first-class modules and functors (which is already basically very equivalent to what you'd expect from objects).
Besides that, objects have structural typing, and you can even create objects without classes (somewhat similarish to anonymous classes, except instead of interfaces you have the structural typing to give you something like statically typed duck typing).
OCaml also has multiple inheritance and friend classes.
Besides that, objects have structural typing, and you can even create objects without classes (somewhat similarish to anonymous classes, except instead of interfaces you have the structural typing to give you something like statically typed duck typing).
OCaml also has multiple inheritance and friend classes.