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 PAA09328; Wed, 28 Apr 2004 15:40:32 +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 PAA09332 for ; Wed, 28 Apr 2004 15:40:31 +0200 (MET DST) Received: from smtp3.adl2.internode.on.net (smtp3.adl2.internode.on.net [203.16.214.203]) by nez-perce.inria.fr (8.12.10/8.12.10) with ESMTP id i3SDeSjq013373 for ; Wed, 28 Apr 2004 15:40:29 +0200 Received: from [192.168.1.200] (ppp119-113.lns1.syd2.internode.on.net [150.101.119.113]) by smtp3.adl2.internode.on.net (8.12.9/8.12.9) with ESMTP id i3SDdrk2012671; Wed, 28 Apr 2004 23:09:55 +0930 (CST) Subject: Re: [Caml-list] [ANN] The Missing Library From: skaller Reply-To: skaller@users.sourceforge.net To: Nicolas Cannasse Cc: "Yaron M. Minsky" , Brian Hurt , Martin Berger , The Caml Trade In-Reply-To: <010501c42d1d$86ed32d0$ef01a8c0@warp> References: <1083140676.9537.831.camel@pelican.wigram> <1083151902.29774.18.camel@localhost.localdomain> <1083154175.9537.944.camel@pelican.wigram> <010501c42d1d$86ed32d0$ef01a8c0@warp> Content-Type: text/plain Message-Id: <1083159592.9537.961.camel@pelican.wigram> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 (1.2.2-4) Date: 28 Apr 2004 23:39:53 +1000 Content-Transfer-Encoding: 7bit X-Miltered: at nez-perce by Joe's j-chkmail ("http://j-chkmail.ensmp.fr")! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 sourceforge: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 9660: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. 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. However, given an enumeration, I agree there is some kind of polyadic behaviour represented. -- John Skaller, mailto:skaller@users.sf.net voice: 061-2-9660-0850, snail: PO BOX 401 Glebe NSW 2037 Australia Checkout the Felix programming language http://felix.sf.net ------------------- 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