|
|
|
|
|
by jordwalke
4018 days ago
|
|
This is also great cheat sheet for someone still getting used to the OCaml syntax. I usually advise people to pretend that double semicolons don't exist for anything but the interactive top level. In source files, you can forget about double semis entirely as long as you just remember to always assign the result of an imperative statement to the dummy "_" name. let _ = print_string "hi"
Then you can think of ;;<enter> as merely a fancy way of hitting the return key in the interactive REPL. There's also a way to use a different key mapping (control+enter) instead of ;; in utop, so there would be no reason to even acknowledge the existence of double semis.
https://github.com/diml/utop/issues/131 |
|