▲ | IshKebab 7 hours ago | |
I 100% agree. The lack of clear scoping and function call grouping syntax just turns it into a word soup. It becomes difficult to parse for humans and I spend a stupid amount of time just getting the semicolons, begin/ends, etc. right. It's like... when you mismatch brackets or braces in a C-style language, except to resolve the problem you can't just find the bracket that's highlighted in red and count; you have to read an essay. I don't know why there are so many people here defending it. It's pretty clearly very elegant, but extremely inconvenient. | ||
▲ | dgan an hour ago | parent | next [-] | |
Use ocamlformat and set "profile = janestreet" | ||
▲ | edwintorok 6 hours ago | parent | prev [-] | |
That can be indeed very confusing when you initially learn the language. However there are 3 things that can help: * An auto-formatter (ocamlformat integration in your editor, or ocaml-top) that shows how the actual nesting looks like * You can add ;; at the end of a top-level function to get a syntax error at a better location * Use the LSP integration of your editor which will show you where the error is as you type, so you catch the problem early |