title: Why this OCaml syntax error
body: <p>I have this code in Ocaml</p>
  
  <pre><code>let double x = 2 * x
  
  let triple x = 3 * x
  
  let s = "Hello" in print_endline s
  
  let () = triple 10 |&gt; string_of_int |&gt; print_endline
  </code></pre>
  
  <p>and when compiling with <code>ocamlc file.ml</code> this gives the error:</p>
  
  <pre><code>File "file.ml", line 5, characters 16-18:
  Error: Syntax error
  </code></pre>
  
  <p>If I put <code>;;</code> at the end of line 3 like this</p>
  
  <pre><code>let triple x = 3 * x;;
  </code></pre>
  
  <p>of if I comment characters 16-18 in line 5 like this</p>
  
  <pre><code>let s = "Hello" (* in print_endline s *)
  </code></pre>
  
  <p>the syntax error goes away.</p>
  
  <p>Can someone explain the reason of the syntax error, and what each of these two corrections do to resolve it?</p>