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] generic programming
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: John Max Skaller <skaller@o...>
Subject: Re: [Caml-list] Re: generic programming
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 
and it misses the ability to iterate over a range with a specified endpoint.
More general iterators need a more sophisticated interface, but the 
can be generalised to returning a tuple of closures [deref, increment, 
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,
snail:10/1 Toxteth Rd, Glebe, NSW 2037, Australia.

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