|
|
|
|
|
by WastingMyTime89
1146 days ago
|
|
No, the syntax parts he criticises are not this kind (they are not ambiguous by the way). What’s in the article is very unidiomatic OCaml incorrectly intended purposefully to make it look like it’s doing something else than what it does. You don’t write tuples without parentheses because it’s weird, harder to read and no one does it. Same for the precedence rules of expression. You just use begin and end for blocks like you would use braces in C because you actually want to write a block. No one is just randomly writing nested code without them because well it doesn’t work. It’s not a quirk. The author is just complaining that you have to mark blocks like in every language. That’s a weird thing to complain about. I agree that the lack of as-hoc polymorphism is a downside (I don’t agree with how the article presents it but the article is disingenuous from the start anyway). Everyone would like to have modular implicit. |
|
> You don’t write tuples without parentheses
> Same for the precedence rules of expression. You just use begin and end for blocks
This is exactly what I wrote, but in a Stockholm-syndrome-y way.
> The author is just complaining that you have to mark blocks like in every language.
He points out a real ambiguity in the syntax where the parser literally parses the same-looking and same-behaving statements completely differently.
Sure it's solved by "you just write begin-end" workaround that you internalise. Or it could be solved at the syntax level (like erlang and elixir)