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 QAA11254; Wed, 28 Apr 2004 16:03:00 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id QAA11243 for ; Wed, 28 Apr 2004 16:02:59 +0200 (MET DST) Received: from postfix3-1.free.fr (postfix3-1.free.fr [213.228.0.44]) by concorde.inria.fr (8.12.10/8.12.10) with ESMTP id i3SE2wYM031864 for ; Wed, 28 Apr 2004 16:02:58 +0200 Received: from warp (lns-th2-5f-81-56-197-80.adsl.proxad.net [81.56.197.80]) by postfix3-1.free.fr (Postfix) with SMTP id 7AF4DC4D0E; Wed, 28 Apr 2004 16:02:57 +0200 (CEST) Message-ID: <01c201c42d29$63c88050$ef01a8c0@warp> From: "Nicolas Cannasse" To: Cc: "Yaron M. Minsky" , "Brian Hurt" , "Martin Berger" , "The Caml Trade" References: <1083140676.9537.831.camel@pelican.wigram> <1083151902.29774.18.camel@localhost.localdomain> <1083154175.9537.944.camel@pelican.wigram> <010501c42d1d$86ed32d0$ef01a8c0@warp> <1083159592.9537.961.camel@pelican.wigram> Subject: Re: [Caml-list] [ANN] The Missing Library Date: Wed, 28 Apr 2004 16:02:05 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1409 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409 X-Miltered: at concorde by Joe's j-chkmail ("http://j-chkmail.ensmp.fr")! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; cannasse:01 warplayer:01 caml-list:01 2004:99 cannasse:01 extlib:01 enum:01 extlib:01 enums:01 enums:01 enumerator:01 abstractly:01 enum:01 iterator:01 dynamically:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk > On Wed, 2004-04-28 at 22:36, Nicolas Cannasse wrote: > > > There is ExtLib Enum.map that's pretty good at doing that. > > Yes indeed. Extlib enums are very promising. > > > That's exactly the same as ExtLib enums : define an enumerator for your data > > structure, and you can apply a full range of algorithms on it. I don't > > really understand the difference with STL. > > I think there are a couple of differences. > > First, Extlib enums are weaker than STL iterators abstractly. > An enum is a single object representing the *tail* of an enumeration. > An STL iterator represents a *position*. Thus for example > two STL iterators represent the tail of an enumeration. > This is much more powerful (and also less safe dynamically). > STL iterators can also be used to denote insertion points, > result of a search, etc. Such comparison tail = end , is also well fitted for the C++ world, where in general NULL is the end of everything, and operator overloading helps here a lot. Just one question : what is the excepted behavior of equality between two iterators coming from two different data structures - both containing the same type of elements ? What about equality between two iterators over two different dynamic arrays ? Is the first iterator index-bounded by the second array (the one it's not itering on) ? > Secondly, the semantics of STL iterators are more refined > and better specified. There are several classes of STL > iterators (input, output, forward, bidirectional, ..). > Also the invalidation conditions are dealt with > in detail. STL iterators also have minimum laziness > of one value..the laziness of enums is not quite > so well defined... recall I had some problems > with the specifications and still do. Please state clearly your problems on the ExtLib mailling list, I will be happy to think about theses :) Enums are still young so there not yet specialized enums that can remove elements while itering or give random access. Maybe in the future... Best Regards, Nicolas Cannasse ------------------- 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