But then it has quirks like using ;; to end statements (EDIT: only in the REPL). And comments with that weird syntax
But worse of all are the optional parenthesis in function calls. Yes, I know Ruby has it. But it feel super weird and a needless flexibility (that causes more confusion than it solves).
I have to interject here for the sake of those unfamiliar with OCaml and who may take the parent comment at face value.
Saying "it has quirks like using ;; to end statements" is misleading to the point of just being bogus. The double semi-colon is only ever used in the REPL. In fact, I've been programming OCaml for fun and professionally for over 15 years, and I've never used a double semi-colon in my code, nor have I ever encountered one in the "wild".
> worst of all are the optional parenthesis in function calls
??
> let r = some_function x y z in ...
There are no parentheses here, and it's not optional.
What you probably are missing is that if `some_function` takes 3 arguments,
then `some_function x y` is a function value that takes 1 parameter (currying).
Btw, iirc, SML doesn't have this: there you only have 1 parameter but it could be a tuple
> Btw, iirc, SML doesn't have this: there you only have 1 parameter but it could be a tuple
Nah, SML does also support automatically curried function definitions, it's just that by convention that feature didn't get used as often. I tried to find out why that was the case a while ago, and stumbled on this explanation: https://www.reddit.com/r/ProgrammingLanguages/comments/jde9x...
isn't that the case in most programming languages ? In essence, if you have an expression exp then (exp) is also an expression. So nothing special about OCaml in that regard.
[note, just checked python, php, and js and it is the case]
But then it has quirks like using ;; to end statements (EDIT: only in the REPL). And comments with that weird syntax
But worse of all are the optional parenthesis in function calls. Yes, I know Ruby has it. But it feel super weird and a needless flexibility (that causes more confusion than it solves).
I can't get over this stuff, sorry.