caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: John Prevost <j.prevost@gmail.com>
To: Caml Mailing List <caml-list@inria.fr>
Subject: Re: [Caml-list] Are map and iter guaranteed to be called in forwards order?
Date: Tue, 17 Aug 2004 10:26:59 -0400	[thread overview]
Message-ID: <d849ad2a040817072662fa8908@mail.gmail.com> (raw)
In-Reply-To: <20040817120053.GA9749@annexia.org>

On Tue, 17 Aug 2004 13:00:53 +0100, Richard Jones <rich@annexia.org> wrote:
> Are the map and iter[1] functions guaranteed to be called in the
> expected order?  In other words will this always produce the same
> result:
  {...}
> [1] From List, for example, but could equally apply to the other
> library modules.

You should also note that both map and iter can sensibly be provided
for data structures that don't have any strong guarantee of order at
all.  For example, a set.  As a rule of thumb, I'd say it's best not
to depend on order in these calls unless (perhaps) you have
implemented the routine yourself, or are using a library that
specifically says what order the calls will be processed.

As Damien says, the documentation for List.map makes no guarantee of
order, while List.iter's documentation says that it is identical to
another construct that does guarantee order.

John.

-------------------
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


  parent reply	other threads:[~2004-08-17 14:27 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-08-17 12:00 Richard Jones
2004-08-17 12:45 ` Damien Doligez
2004-08-17 14:26 ` John Prevost [this message]
2004-08-17 14:56   ` Richard Jones
2004-08-17 15:13     ` Anil Madhavapeddy
2004-08-17 15:17     ` Jean-Marie Gaillourdert
2004-08-17 15:19     ` John Prevost
2004-08-18  0:57   ` Jon Harrop
2004-08-18  5:11     ` skaller
2004-08-18  7:10       ` skaller

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=d849ad2a040817072662fa8908@mail.gmail.com \
    --to=j.prevost@gmail.com \
    --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).