title: Printing OCaml AST as OCaml Code
body: <p>I have this piece of code that contains a camlp4 quotation.</p>
  
  
  
  <pre class="lang-ml prettyprint-override"><code>let f_name = "my_func"
  &lt;:str_item&lt; value $lid:f_name$ a = a * 2 &gt;&gt;
  </code></pre>
  
  <p>After running this through <code>camlp4of</code>, it produces this:</p>
  
  <pre class="lang-ml prettyprint-override"><code>  Ast.StExp (_loc,
      (Ast.ExApp (_loc,
         (Ast.ExApp (_loc, (Ast.ExId (_loc, (Ast.IdLid (_loc, "=")))),
            (Ast.ExApp (_loc,
               (Ast.ExApp (_loc,
                  (Ast.ExId (_loc, (Ast.IdLid (_loc, "value")))),
                  (Ast.ExId (_loc, (Ast.IdLid (_loc, f_name)))))),
               (Ast.ExId (_loc, (Ast.IdLid (_loc, "a")))))))),
         (Ast.ExApp (_loc,
            (Ast.ExApp (_loc, (Ast.ExId (_loc, (Ast.IdLid (_loc, "*")))),
               (Ast.ExId (_loc, (Ast.IdLid (_loc, "a")))))),
            (Ast.ExInt (_loc, "2")))))))
  </code></pre>
  
  <p>My question is this, is there anyway to print the generated ocaml code? What <code>camlp4of</code> command or option should I use to show the code? What I expect to see from the above example is:</p>
  
  <pre class="lang-ml prettyprint-override"><code>value my_func a = a * 2
  </code></pre>
  
  <p>Is that possible? The reason is because I want to do some debugging to see how the generated ocaml code looks like.</p>