From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id NAA00033; Wed, 13 Oct 2004 13:21:03 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f 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 NAA00346 for ; Wed, 13 Oct 2004 13:21:02 +0200 (MET DST) Received: from alex.barettalocal.com (h213-255-109-130.albacom.net [213.255.109.130] (may be forged)) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id i9DBL1DE013588 for ; Wed, 13 Oct 2004 13:21:02 +0200 Received: from [127.0.0.1] (localhost.localdomain [127.0.0.1]) by alex.barettalocal.com (Postfix) with ESMTP id 0CBE92BAA5A for ; Wed, 13 Oct 2004 13:22:36 +0200 (CEST) Message-ID: <416D0FFB.4000802@baretta.com> Date: Wed, 13 Oct 2004 13:22:35 +0200 From: Alex Baretta User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20040913 X-Accept-Language: it, en-us, en MIME-Version: 1.0 Cc: caml-list@inria.fr Subject: Re: [Caml-list] Recursive lists References: <20041011063203.GA13870@force.stwing.upenn.edu> In-Reply-To: <20041011063203.GA13870@force.stwing.upenn.edu> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Miltered: at nez-perce with ID 416D0F9D.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; baretta:01 baretta:01 caml-list:01 lovas:01 2004:99 tails:01 ocaml:01 ocaml:01 equality:01 equality:01 alex:01 alex:01 nodes:02 circular:03 wrote:03 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk William Lovas wrote: > On Sun, Oct 10, 2004 at 07:44:25PM -0500, Brian Hurt wrote: >> >>Note: I haven't tested the above functions, but they give you the idea of >>how to handle circular lists. > > > ... and this isn't it :) I think Alex was more on the right track with the > idea of maintaining a list of tails... > > cheers, > William Exactly: physical equality of nodes has nothing to do with the physical equality of lists. Ocaml allows sharing, so the same object can appear in more than one position even in an ordinary list or in any other Ocaml datastructure. e.g. let l = let x = <...> in let y = <...> in [x; y; y; x; ...] Here the first and fourth element are physically equal, as well as the second and third. Alex ------------------- 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