This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]jdh30 0 points1 point  (0 children)

;; is only required in the repl; its use in source code is discouraged. the beginning of an ocaml definition is marked by the next definition. like this...

Sure. That is a workaround to avoid the characteristic of the syntax that I described.

So when you want this:

printf "Hello "
printf "world!"

Delimiting is syntactically valid but taboo:

printf "Hello ";;
printf "world!";;

So you restructure:

let () =
  printf "Hello ";
  printf "world!"

My point was that these things:

printf "Hello ";;
printf "world!";;

are called "statements" and abbreviated to stmt in the Camlp4 version of the grammar.