caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] Are map and iter guaranteed to be called in forwards order?
@ 2004-08-17 12:00 Richard Jones
  2004-08-17 12:45 ` Damien Doligez
  2004-08-17 14:26 ` John Prevost
  0 siblings, 2 replies; 10+ messages in thread
From: Richard Jones @ 2004-08-17 12:00 UTC (permalink / raw)
  To: caml-list


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:

# let i = ref 0 ;;
val i : int ref = {contents = 0}
# let xs = List.map (fun _ -> incr i; !i) [ 1;1;1;1;1;1;1;1 ];;
val xs : int list = [1; 2; 3; 4; 5; 6; 7; 8]

Rich.

[1] From List, for example, but could equally apply to the other
library modules.

-- 
Richard Jones. http://www.annexia.org/ http://www.j-london.com/
Merjis Ltd. http://www.merjis.com/ - improving website return on investment
NET::FTPSERVER is a full-featured, secure, configurable, database-backed
FTP server written in Perl: http://www.annexia.org/freeware/netftpserver/

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


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2004-08-18  7:10 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-08-17 12:00 [Caml-list] Are map and iter guaranteed to be called in forwards order? Richard Jones
2004-08-17 12:45 ` Damien Doligez
2004-08-17 14:26 ` John Prevost
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

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