<?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/12/78f7eb64b20320970621cfe5b9407fa8"
  from="Damien Doligez &lt;damien.doligez@i...&gt;"
  author="Damien Doligez"
  date="2002-12-10T13:21:15"
  subject="Re: [Caml-list] Camlp4: generating printers of types"
  prev="2002/12/560c45075f7edea334c281d5649ef2ac"
  next="2002/12/e1ac75aaf2bd8e19f9cdb8dcfae122b0"
  prev-in-thread="2002/12/be95aad281fdfa0b0e17d2aadce6fe33"
  next-in-thread="2002/10/c2f4146f681d505fc6e36fd0892119d5"
  prev-thread="2002/10/1dd4307f336f52923ec9c00bf50e6612"
  next-thread="2002/10/bd720bbf86918b2c2bc40fcc8d8f5f47"
  root="../../"
  period="month"
  listname="caml-list"
  title="Archives of the Caml mailing list">

<thread subject="[Caml-list] Camlp4: generating printers of types">
<msg 
  url="2002/10/911fcb8a222e666411b28b0649e3d30d"
  from="Daniel de Rauglaudre &lt;daniel.de_rauglaudre@i...&gt;"
  author="Daniel de Rauglaudre"
  date="2002-10-09T13:13:19"
  subject="[Caml-list] Camlp4: generating printers of types">
<msg 
  url="2002/12/bda14d3a04f2eedf91905a4eb42a9207"
  from="Ken Rose &lt;kenarose@e...&gt;"
  author="Ken Rose"
  date="2002-12-10T02:02:03"
  subject="Re: [Caml-list] Camlp4: generating printers of types">
<msg 
  url="2002/12/38d206434ca03422a3daee596c95db10"
  from="Daniel de Rauglaudre &lt;daniel.de_rauglaudre@i...&gt;"
  author="Daniel de Rauglaudre"
  date="2002-12-10T12:25:03"
  subject="Re: [Caml-list] Camlp4: generating printers of types">
<msg 
  url="2002/12/adca70ed0317d2ff1156d25d7bb3384b"
  from="Ken Rose &lt;kenarose@e...&gt;"
  author="Ken Rose"
  date="2002-12-10T15:33:32"
  subject="Re: [Caml-list] Camlp4: generating printers of types">
<msg 
  url="2002/12/be95aad281fdfa0b0e17d2aadce6fe33"
  from="Daniel de Rauglaudre &lt;daniel.de_rauglaudre@i...&gt;"
  author="Daniel de Rauglaudre"
  date="2002-12-10T17:38:21"
  subject="Re: [Caml-list] Camlp4: generating printers of types">
</msg>
</msg>
</msg>
<msg 
  url="2002/12/78f7eb64b20320970621cfe5b9407fa8"
  from="Damien Doligez &lt;damien.doligez@i...&gt;"
  author="Damien Doligez"
  date="2002-12-10T13:21:15"
  subject="Re: [Caml-list] Camlp4: generating printers of types">
</msg>
</msg>
<msg 
  url="2002/10/c2f4146f681d505fc6e36fd0892119d5"
  from="Markus Mottl &lt;markus@o...&gt;"
  author="Markus Mottl"
  date="2002-10-09T17:18:14"
  subject="Re: [Caml-list] Camlp4: generating printers of types">
</msg>
<msg 
  url="2002/10/6b5af3e32f8ae3e379720ca547b582df"
  from="Ken Rose &lt;kenarose@e...&gt;"
  author="Ken Rose"
  date="2002-10-25T19:20:41"
  subject="Re: [Caml-list] Camlp4: generating printers of types">
<msg 
  url="2002/10/e90a6df400ab02125298d0c75314986e"
  from="Chris Hecker &lt;checker@d...&gt;"
  author="Chris Hecker"
  date="2002-10-25T20:02:23"
  subject="Re: [Caml-list] Camlp4: generating printers of types">
</msg>
<msg 
  url="2002/10/b87035709e416e656037bec29d7ea9c8"
  from="Daniel de Rauglaudre &lt;daniel.de_rauglaudre@i...&gt;"
  author="Daniel de Rauglaudre"
  date="2002-10-26T00:11:55"
  subject="Re: [Caml-list] Camlp4: generating printers of types">
</msg>
</msg>
</msg>
</thread>

<contents>
On Tuesday, Dec 10, 2002, at 03:01 Europe/Paris, Ken Rose wrote:

&gt; type t = int let rec print_t = print_int
&gt;
&gt; Which the compiler rejects with "This kind of expression is not allowed
&gt; as right-hand side of `let rec'"  I haven't been able to figure out a
&gt; way to sneak it past, either.  What's going on here?  Why can't I 
&gt; rename
&gt; print_int?

The problem here is that you are using "let rec" to define a
non-functional value which is not recursive.  O'Caml 3.06 can handle
some such definitions but not all of them.  We have worked a bit on
the "let rec" restrictions and the current CVS version of O'Caml accepts
all non-recursive definitions in a let rec.

You have several solutions:
1. wait for the next release of O'Caml (no expected date yet)
2. use the CVS version (and be a beta-tester)
3. get rid of the "rec" in your generated code in the case where you
    are only renaming a function
4. use eta-conversion to make it a functional value:
      let rec print_t x = print_int x

-- Damien

-------------------
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>

