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 TAA27399; Fri, 8 Oct 2004 19:18:31 +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 TAA27376 for ; Fri, 8 Oct 2004 19:18:30 +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 i98HIT84013588 for ; Fri, 8 Oct 2004 19:18:30 +0200 Received: from [127.0.0.1] (localhost.localdomain [127.0.0.1]) by alex.barettalocal.com (Postfix) with ESMTP id 7ECA6F386A; Fri, 8 Oct 2004 19:19:58 +0200 (CEST) Message-ID: <4166CC3E.3080909@baretta.com> Date: Fri, 08 Oct 2004 19:19:58 +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 To: David Brown , caml-list@pauillac.inria.fr Subject: Re: [Caml-list] Recursive lists References: <4166A764.3010905@baretta.com> <20041008154347.GA14210@old.davidb.org> In-Reply-To: <20041008154347.GA14210@old.davidb.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Miltered: at nez-perce with ID 4166CBE5.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 2004:99 beforehand:01 cyclic:01 cyclic:01 logically:01 alex:01 alex:01 0200,:01 module:03 overhead:03 overhead:03 dave:03 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk David Brown wrote: > On Fri, Oct 08, 2004 at 04:42:44PM +0200, Alex Baretta wrote: > >>Keith Wansbrough wrote: > > I doubt that most users of list operations want the extra overhead needed > to check for cycles. Recursive lists are fairly rare in strict languages. I agree. They are very rarely of any use. > Dave I agree. I would not want the overhead in general, unless I knew beforehand that cyclic list are possible. But this is an optimization we can count on so long as we can prove the invariant that our structures are not cyclic. This is obvious in the core language (no Obj), but might not be so if functions linke cycle are available. When the invariant cannot be proven valid for all meaningful input, or when it is known that the input can reasonably be cyclic, then I argue that the standard library should provide some means to manipulate the such structures safely. Of course, a separate Cyclic_list module could be defined to access the cyclic-safe functions, but from an abstract point of view such functions logically belong to List. 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