> OCaml is a high-level language that supports […] object-oriented programming style
AFAIK OCaml only support records, which are like C’s structs.
Edit: no, it has real objects, as stated in comments below.
AFAIK OCaml only support records, which are like C’s structs.
Edit: no, it has real objects, as stated in comments below.
https://realworldocaml.org/v1/en/html/objects.html
You can do a lot of traditional 'OO'-style things with functors and modules, though, so you don't need objects necessarily to get a lot of OO features.
See: http://caml.inria.fr/pub/docs/manual-ocaml-4.00/manual005.ht...
http://caml.inria.fr/pub/docs/manual-ocaml/objectexamples.ht...
seems to state otherwise. That said, I think the common advice is to not use most of that and to restrict yourself to just records as they are almost always the better choice.