<?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="2002/07/8aaf29027d45ab74beaf633b7b6c51b7"
  from="Daniel de Rauglaudre &lt;daniel.de_rauglaudre@i...&gt;"
  author="Daniel de Rauglaudre"
  date="2002-07-03T08:08:10"
  subject="Re: [Caml-list] camlp4 and anonymous function naming"
  prev="2002/07/75d4aecf09efc05caede6b7c53c1292f"
  next="2002/07/086229a0f9b30e86a6556869bfe538ce"
  prev-in-thread="2002/07/69515a2d7d7e36df2caff6fbd0eddfa3"
  next-in-thread="2002/07/380f1d9276b23b4d004f27ca65e5bb07"
  prev-thread="2002/07/1c3e421998b8c597856d6c991ff07910"
  next-thread="2002/07/729263137a5c609a8795ff7b62ccf4d0"
  root="../../"
  period="month"
  listname="caml-list"
  title="Archives of the Caml mailing list">

<thread subject="[Caml-list] embedding OCaml into C on win32">
<msg 
  url="2002/07/562bfd7c9196fc3abcb454d8d4965868"
  from="Alexander V.Voinov &lt;avv@q...&gt;"
  author="Alexander V.Voinov"
  date="2002-07-02T18:59:08"
  subject="[Caml-list] embedding OCaml into C on win32">
<msg 
  url="2002/07/69515a2d7d7e36df2caff6fbd0eddfa3"
  from="Julie Farago &lt;farago@e...&gt;"
  author="Julie Farago"
  date="2002-07-02T20:48:24"
  subject="[Caml-list] camlp4 and anonymous function naming">
<msg 
  url="2002/07/8aaf29027d45ab74beaf633b7b6c51b7"
  from="Daniel de Rauglaudre &lt;daniel.de_rauglaudre@i...&gt;"
  author="Daniel de Rauglaudre"
  date="2002-07-03T08:08:10"
  subject="Re: [Caml-list] camlp4 and anonymous function naming">
</msg>
</msg>
<msg 
  url="2002/07/380f1d9276b23b4d004f27ca65e5bb07"
  from="Alexander V.Voinov &lt;avv@q...&gt;"
  author="Alexander V.Voinov"
  date="2002-07-02T21:33:28"
  subject="Re: [Caml-list] embedding OCaml into C on win32">
<msg 
  url="2002/07/1938bd06a7295f31e5fee044ccfdda3a"
  from="Alexander V.Voinov &lt;avv@q...&gt;"
  author="Alexander V.Voinov"
  date="2002-07-02T22:35:38"
  subject="Re: [Caml-list] embedding OCaml into C on win32">
</msg>
</msg>
</msg>
</thread>

<contents>
Hi,

On Tue, Jul 02, 2002 at 04:48:22PM -0400, Julie Farago wrote:

&gt; let givenames loc vars e =
&gt;   let name = namefun "my" in
&gt;     &lt;:expr&lt;
&gt;       let $lid:name$ $vars$ = $e$
&gt;       in $lid:name$ &gt;&gt;
&gt; 
&gt; This code is, of course, wrong. The problem is that I cannot figure out
&gt; how to simply capture the args from the fun and place them back into the
&gt; let.

Write this function like this:

let givenames loc vars e =
  let name = namefun "my" in
  let e =
    List.fold_right (fun p e -&gt; &lt;:expr&lt; fun $lid:p$ -&gt; $e$ &gt;&gt;) vars e
  in
    &lt;:expr&lt;
      let $lid:name$ = $e$
      in $lid:name$ &gt;&gt;

-- 
Daniel de RAUGLAUDRE
daniel.de_rauglaudre@inria.fr
http://cristal.inria.fr/~ddr/
-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners

</contents>

</message>

