4 ms·
The weirdest OCaml syntax (to me) is the way that that exceptions are essentially reversed camel case mixed with snake case (e.g `Not_found`, `Division_by_zero`
by saghm 10y ago
The weirdest OCaml syntax (to me) is the way that that exceptions are essentially reversed camel case mixed with snake case (e.g `Not_found`, `Division_by_zero`). I assume that this was to try to imitate the structure of English sentences, but it feels bizarre to me when I see it in code.
- dllthomas 10y ago> the structure of English sentences Or possibly French sentences...
- saghm 10y agoGood point, I forgot that OCaml is French. On a related note, I've heard that might be related to why the common style is to prefix the colon used for type annotations with a space, whereas in some other languages with that syntax (e.g. Rust and Scala), it's more common to see no space before the colon.