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] Iterators and lazy lists
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2001-07-10 (05:33)
From: Alexander V. Voinov <avv@q...>
Subject: [Caml-list] Iterators and lazy lists
Hi All,

I didn't fully understand from the docs, what is the preferred way to
generate lazy (e.g., computed on demand) lists in OCaml, like what is
achieved in Python via __getitem__. Should I generate a stream for this,
or define an iterator like in C++?

I'd like to find an analog of the following in Python:

for item in myCustomDict.lazyItems():
	if found(item):

Certainly, a recursive traversal solution is preferred over a looping

Thank you in advance

Bug reports:  FAQ:
To unsubscribe, mail  Archives: