title: OCaml syntax error in function
body: <p>I have to create a function which will display each element from a set of strings. I did the following:</p>
  
  <pre><code>module S = Set.Make(String);;
  module P = Pervasives;;
  let write x = (
          P.print_string("{"); let first = true;
      S.iter (fun str -&gt; (if first then () else P.print_string(","); P.print_string(str))) x;
      P.print_string("}");
      P.print_newline
    );;
    ^
  </code></pre>
  
  <p>At the end of the program (where I placed that sign) it appears I have an error: Syntax error: operator expected.
  Please help me solve this.</p>