Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] [ANN] The Missing Library
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: skaller <skaller@u...>
Subject: Re: [Caml-list] [ANN] The Missing Library
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