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 XAA25500; Wed, 28 Apr 2004 23:14:44 +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 XAA25485 for ; Wed, 28 Apr 2004 23:14:43 +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 i3SLEcjq004781 for ; Wed, 28 Apr 2004 23:14:40 +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 i3SFpOk2034397; Thu, 29 Apr 2004 01:21:30 +0930 (CST) Subject: Re: [Caml-list] [ANN] The Missing Library From: skaller Reply-To: skaller@users.sourceforge.net To: Jean-Christophe Filliatre Cc: "Yaron M. Minsky" , Brian Hurt , Martin Berger , The Caml Trade In-Reply-To: <16527.49747.433942.267909@gargle.gargle.HOWL> References: <1083140676.9537.831.camel@pelican.wigram> <1083151902.29774.18.camel@localhost.localdomain> <1083154175.9537.944.camel@pelican.wigram> <16527.44649.729729.106381@gargle.gargle.HOWL> <1083162666.9537.983.camel@pelican.wigram> <16527.49747.433942.267909@gargle.gargle.HOWL> Content-Type: text/plain Message-Id: <1083167483.9537.1064.camel@pelican.wigram> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 (1.2.2-4) Date: 29 Apr 2004 01:51:24 +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 filliatre:01 iterator:01 iterator:01 implemented:01 triples:01 unit-:01 unit-:01 'step':99 9660:01 glebe:01 semantics:01 token:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Thu, 2004-04-29 at 00:40, Jean-Christophe Filliatre wrote: > skaller writes: > > > > Perhaps the iterator is actually the triple: > > > > (iterator, step, get) > > In the particular case of ocamlgraph, the iterators are not > implemented as functions triples (though they could be). I meant that 'mathematically' the actual iterator is a triple. You need to specify more than the 'iterator value' to specify an iterator: you need its methods too. Similar to 'cartesian product' is not a value, but a value and a pair of projection functions. Categorically .. the value is an irrelavance: only the functions *actually* matter .. so perhaps an iterator *really* is just a pair: step:unit->unit get: unit->'a which is what Andreas Rossburg said earlier, except he combined 'step' into 'get' and added a termination condition: get: unit -> 'a option Example is the well known function 'get_token()' used by parsers. Actually, this is an input iterator. Step/get is a forward iterator. Input iterators have no interesting semantics, they don't have enough structure. -- 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