3 ms·
> I would welcome the chance, though I wonder if one finds the same kind of dogmatism as in the OOP world...("it must be a pure function!") Nah, OCaml is a ver
by naasking 8y ago
> I would welcome the chance, though I wonder if one finds the same kind of dogmatism as in the OOP world...("it must be a pure function!")
Nah, OCaml is a very practical functional language, that's why it features mutable state. You just have to opt-in, so it just encourages [im]mutability as a default, as it should.
Edit: fixed typo!
- badpenny 8y agoDo you mean "encourages immutability as a default"?
- p4bl0 8y agoYes, that's what he meant ;). In OCaml references are always explicit (different syntax) and mutable field in records must be declared explicitly as mutable. However, OCaml does not bother you too much (as compared to Haskell for instance) when using side effects like printing.