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 WAA26659; Fri, 5 Jul 2002 22:31:27 +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 WAA28599 for ; Fri, 5 Jul 2002 22:31:26 +0200 (MET DST) Received: from sunny.pacific.net.au (sunny.pacific.net.au [203.25.148.40]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id g65KVM901777; Fri, 5 Jul 2002 22:31:23 +0200 (MET DST) Received: from wisma.pacific.net.au (wisma.pacific.net.au [210.23.129.72]) by sunny.pacific.net.au with ESMTP id g65KVHSs015536; Sat, 6 Jul 2002 06:31:17 +1000 (EST) Received: from ozemail.com.au (ppp141.dyn18.pacific.net.au [61.8.18.141]) by wisma.pacific.net.au with ESMTP id GAA19498; Sat, 6 Jul 2002 06:31:15 +1000 (EST) Message-ID: <3D260213.20402@ozemail.com.au> Date: Sat, 06 Jul 2002 06:31:15 +1000 From: John Max Skaller User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.2.1) Gecko/20010901 X-Accept-Language: en-us MIME-Version: 1.0 To: Chris Hecker CC: Xavier Leroy , Francois Pottier , caml-list@inria.fr Subject: Re: [Caml-list] Re: generic programming References: <4.3.2.7.2.20020705024112.038909f0@mail.d6.com> <20020705104249.B14853@pauillac.inria.fr> <200207030246.WAA28665@dewberry.cc.columbia.edu> <4.3.2.7.2.20020703102610.0248b280@mail.d6.com> <3D246739.4030204@ozemail.com.au> <20020705104249.B14853@pauillac.inria.fr> <20020705112551.B16273@pauillac.inria.fr> <4.3.2.7.2.20020705024112.038909f0@mail.d6.com> <4.3.2.7.2.20020705094337.0392bd20@mail.d6.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Chris Hecker wrote: > > I need to look at Francois' solution, so I'm not sure yet. It's semantically equivalent to input iterators, though the syntax is different, and it misses the ability to iterate over a range with a specified endpoint. More general iterators need a more sophisticated interface, but the technique can be generalised to returning a tuple of closures [deref, increment, compare, etc, rather than just 'next'] (effectively, a set of methods on the object which is the state encapsulated in the function: the usual functional tricky to get object orientation for free :-) > I'm actually not running into a problem right now with this anyway, so > it's academic for me at this point, it was just something I've been > wondering about since I started learning caml and was mentally > comparing it to C++'s templates. I haven't thought about the issues > thoroughly, but maybe John Max Skaller can comment on whether > Francois' iterators are "good enough" for what he was trying to write. heh! It's academic for me too. I was just curious if I could build a version of STL for Ocaml. -- John Max Skaller, mailto:skaller@ozemail.com.au snail:10/1 Toxteth Rd, Glebe, NSW 2037, Australia. voice:61-2-9660-0850 ------------------- 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