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] Are map and iter guaranteed to be called in forwards order?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2004-08-17 (14:27)
From: John Prevost <j.prevost@g...>
Subject: Re: [Caml-list] Are map and iter guaranteed to be called in forwards order?
On Tue, 17 Aug 2004 13:00:53 +0100, Richard Jones <> 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 makes no guarantee of
order, while List.iter's documentation says that it is identical to
another construct that does guarantee order.


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