From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: weis Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id UAA10824 for caml-redistribution@pauillac.inria.fr; Tue, 28 Mar 2000 20:29:49 +0200 (MET DST) Resent-Message-Id: <200003281829.UAA10824@pauillac.inria.fr> Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id CAA24712 for ; Tue, 28 Mar 2000 02:56:27 +0200 (MET DST) Received: from emissary.in.ot.com.au (emissary.ot.com.au [203.42.249.64] (may be forged)) by nez-perce.inria.fr (8.8.7/8.8.7) with SMTP id CAA25269 for ; Tue, 28 Mar 2000 02:56:24 +0200 (MET DST) Received: (qmail 5930 invoked from network); 28 Mar 2000 00:56:21 -0000 Received: from unknown (HELO druid.in.ot.com.au) (10.70.10.5) by 10.70.15.1 with SMTP; 28 Mar 2000 00:56:21 -0000 Received: (qmail 4759 invoked from network); 28 Mar 2000 00:56:20 -0000 Received: from merlin.in.ot.com.au (HELO in.ot.com.au) (203.5.4.26) by druid.in.ot.com.au with SMTP; 28 Mar 2000 00:56:20 -0000 Sender: maxs@inria.fr Message-ID: <38E004E8.C28EB2E2@in.ot.com.au> Date: Tue, 28 Mar 2000 11:03:36 +1000 From: Max Skaller X-Mailer: Mozilla 4.61 [en] (X11; I; Linux 2.2.12-20 i686) X-Accept-Language: en MIME-Version: 1.0 To: Damien Doligez CC: caml-list@inria.fr Subject: Re: variables in 'let rec' References: <200003251455.PAA23584@tobago.inria.fr> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Resent-From: weis@pauillac.inria.fr Resent-Date: Tue, 28 Mar 2000 20:29:49 +0200 Resent-To: caml-redistribution@pauillac.inria.fr Damien Doligez wrote: > > >From: Max Skaller > > > >Alternatively, you can just use > > > > let rec x' () = ... > > and ... > > let x = x() > > > >in lieu of what you really wanted: (that is, > >there is a workaround). > > But that doesn't work for "let rec x = 1 :: x", which is the most > interesting feature of O'Caml's recursive value definitions. It doesn't? let rec x'() = 1 :: x()' let x = x'() Seems to work fine. Of course, this will loop forever in an eager language: the result is an infinite list of 1s. -- John (Max) Skaller at OTT [Open Telecommications Ltd] mailto:maxs@in.ot.com.au -- at work mailto:skaller@maxtal.com.au -- at home