<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE message PUBLIC
  "-//MLarc//DTD MLarc output files//EN"
  "../../mlarc.dtd"[
  <!ATTLIST message
    listname CDATA #REQUIRED
    title CDATA #REQUIRED
  >
]>

  <?xml-stylesheet href="../../mlarc.xsl" type="text/xsl"?>


<message 
  url="2009/10/5857935b784b82211e89cc752dc2ad59"
  from="blue storm &lt;bluestorm.dylc@g...&gt;"
  author="blue storm"
  date="2009-10-04T17:45:00"
  subject="Re: [Caml-list] camlp4 + array"
  prev="2009/10/d364f92bdb97360d8449f027692a7ae1"
  next="2009/10/e59e8adec6f0b13ab089ab77b939cacc"
  prev-in-thread="2009/10/d364f92bdb97360d8449f027692a7ae1"
  prev-thread="2009/10/1d7452042a610a8dbce7b15598651158"
  next-thread="2009/10/1fa1f44e18c36509d250514c26be5736"
  root="../../"
  period="month"
  listname="caml-list"
  title="Archives of the Caml mailing list">

<thread subject="camlp4 + array">
<msg 
  url="2009/10/d364f92bdb97360d8449f027692a7ae1"
  from="Anastasia Gornostaeva &lt;ermine@e...&gt;"
  author="Anastasia Gornostaeva"
  date="2009-10-04T17:08:27"
  subject="camlp4 + array">
<msg 
  url="2009/10/5857935b784b82211e89cc752dc2ad59"
  from="blue storm &lt;bluestorm.dylc@g...&gt;"
  author="blue storm"
  date="2009-10-04T17:45:00"
  subject="Re: [Caml-list] camlp4 + array">
</msg>
</msg>
</thread>

<contents>
I suppose you are using the "classical syntax" inside the quotations
(camlp4oof).
You can correct the misbehaviour by switching to the revised syntax
inside the quotations (camlp4orf), but that may require some changes
to your code elsewhere.

I think the easier way to code that with the classical syntax inside
quotations is to use the Ast.exSem_of_list construct :

let quote_int_array arr =
  let quoted_elems = List.map (fun i -&gt; &lt;:expr&lt; $`int:i$ &gt;&gt;)
(Array.to_list arr) in
  &lt;:expr&lt; [| $Ast.exSem_of_list quoted_elems |]$ &gt;&gt;


2009/10/4 Anastasia Gornostaeva &lt;ermine@ermine.pp.ru&gt;:
&gt; Hello.
&gt;
&gt; The code
&gt;
&gt;       let pl =
&gt;            Array.fold_left (fun ls l -&gt; &lt;:expr&lt; $ls$; $`int:l$ &gt;&gt;)
&gt;            &lt;:expr&lt;&gt;&gt; some_array
&gt;          in
&gt;            &lt;:expr&lt; [| $pl$ |] &gt;&gt;
&gt;
&gt; produces somelike [| (1; 2; 3; 4) |], i.e the pl in () brackets.
&gt; How should I do write this code properly?
&gt;
&gt; ermine
&gt;
&gt; _______________________________________________
&gt; Caml-list mailing list. Subscription management:
&gt; http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
&gt; Archives: http://caml.inria.fr
&gt; Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
&gt; Bug reports: http://caml.inria.fr/bin/caml-bugs
&gt;

</contents>

</message>

