Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

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: 2004-04-28 (21:14)
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:

	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,
voice: 061-2-9660-0850, 
snail: PO BOX 401 Glebe NSW 2037 Australia
Checkout the Felix programming language

To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: