<?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/7ee1373a402f5409b88f6f1276dca2cd"
  from="Damien Guichard &lt;alphablock@o...&gt;"
  author="Damien Guichard"
  date="2009-10-23T15:39:23"
  subject="Re: [Caml-list] forbidden construct as right hand side of &quot;let rec&quot;"
  prev="2009/10/68b2925e4155f78c4b1cfea3986cd546"
  next="2009/10/3bcd2f16c7ea93d30f4c2afe13184103"
  next-in-thread="2009/10/39062037ea7b698ed4d0e8eac5722e3f"
  prev-thread="2009/10/61b3aa5e2d0ffb16d5dd3dca5a2afd9a"
  next-thread="2009/10/3bcd2f16c7ea93d30f4c2afe13184103"
  root="../../"
  period="month"
  listname="caml-list"
  title="Archives of the Caml mailing list">

<thread subject="Re: [Caml-list] forbidden construct as right hand side of &quot;let rec&quot;">
<msg 
  url="2009/10/7ee1373a402f5409b88f6f1276dca2cd"
  from="Damien Guichard &lt;alphablock@o...&gt;"
  author="Damien Guichard"
  date="2009-10-23T15:39:23"
  subject="Re: [Caml-list] forbidden construct as right hand side of &quot;let rec&quot;">
<msg 
  url="2009/10/39062037ea7b698ed4d0e8eac5722e3f"
  from="Marc de Falco &lt;marc.defalco@g...&gt;"
  author="Marc de Falco"
  date="2009-10-23T16:15:03"
  subject="Re: [Caml-list] forbidden construct as right hand side of &quot;let rec&quot;">
<msg 
  url="2009/10/7d3be716f3343f93c3c99f20ba3ddb6e"
  from="blue storm &lt;bluestorm.dylc@g...&gt;"
  author="blue storm"
  date="2009-10-23T17:51:09"
  subject="Re: [Caml-list] forbidden construct as right hand side of &quot;let rec&quot;">
</msg>
</msg>
</msg>
</thread>

<contents>

let list_cycle2 a b =
  let rec loop = a::b::loop
  in loop


- damien




En réponse au message
de : Lukasz Stafiniak
du : 2009-10-23 01:10:37
À : caml-list
CC : 
Sujet : Re: [Caml-list] forbidden construct as right hand side of "let rec"

While we are at it, what is the best way to convert a "straight" list
into a cyclic list?

i.e. convert

let l = a::b::[]

into

let rec l = a::b::l

(for arbitrary length lists). (The answer I recall from the archives
was using Obj.magic to mutate the [] in the original list).

On Fri, Oct 23, 2009 at 12:34 AM, Stéphane Glondu  &lt;steph@glondu.net &gt; wrote:
&gt; Mathias Kende a écrit :
&gt; &gt;       let rec g = f g
&gt;
&gt; What about:
&gt;
&gt;  let rec g x = f g x

_______________________________________________
Caml-list mailing list. Subscription management:
http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
Archives: http://caml.inria.fr
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs
</contents>

</message>

