5 ms·
There's a few legitimate issues with OCaml syntax that have been fixed by Reason at least. E.g. `match`/`if` not having an `end` means you need to use parens or
by nv-vn 7y ago
There's a few legitimate issues with OCaml syntax that have been fixed by Reason at least. E.g. `match`/`if` not having an `end` means you need to use parens or `begin`/`end` to nest match and have ; inside of an `if` body. There's also some ambiguity between functional `if` and imperative `if` in some situations.
- toastal 7y agoDespite that, Reason adds semicolons and braces to OCaml; presumably this was to make it have a more JavaScript aesthetic for on-boarding (ignoring JS's ASI)?
- nine_k 7y agoExplicit opening and closing structures help locate and explain errors better. In an absence of an entirely obvious, unambiguous, commonly known way of formatting, it's helpful.
- pjmlp 7y agoBecause OCaml aware editors/IDE don't exist.
- pyrale 7y agoI'm not sure to understand how it helps. Are you talking about parsing errors ? As for formatting, if you manage to get an AST, what would be made easier by braces ?
- nine_k 7y agoYes, parsing errors. In a number of cases you can legitimately continue to interpret a text well past the missing closing token, and signal an error in a place which does not seem related. If you already have a correct AST, you can render it whatever way you want.