caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "Alexander V. Voinov" <avv@quasar.ipa.nw.ru>
To: caml <caml-list@inria.fr>
Subject: [Caml-list] Iterators and lazy lists
Date: Mon, 09 Jul 2001 22:32:31 -0700	[thread overview]
Message-ID: <3B4A936F.B7610C0D@quasar.ipa.nw.ru> (raw)

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):
		break

Certainly, a recursive traversal solution is preferred over a looping
one.

Thank you in advance

Alexander
-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


             reply	other threads:[~2001-07-10  5:33 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-07-10  5:32 Alexander V. Voinov [this message]
2001-07-11 11:09 Willem Duminy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3B4A936F.B7610C0D@quasar.ipa.nw.ru \
    --to=avv@quasar.ipa.nw.ru \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).