From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id OAA21125; Tue, 17 Aug 2004 14:00:56 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id OAA22714 for ; Tue, 17 Aug 2004 14:00:55 +0200 (MET DST) Received: from annexia.force9.co.uk (annexia.force9.co.uk [212.56.101.183]) by concorde.inria.fr (8.12.10/8.12.10) with ESMTP id i7HC0sRM008143 for ; Tue, 17 Aug 2004 14:00:55 +0200 Received: from rich by annexia.force9.co.uk with local (Exim 3.36 #1 (Debian)) id 1Bx2e5-0002Xx-00 for ; Tue, 17 Aug 2004 13:00:53 +0100 Date: Tue, 17 Aug 2004 13:00:53 +0100 To: caml-list@inria.fr Subject: [Caml-list] Are map and iter guaranteed to be called in forwards order? Message-ID: <20040817120053.GA9749@annexia.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.5.1+cvs20040105i From: Richard Jones X-Miltered: at concorde with ID 4121F376.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; val:01 incr:01 val:01 ltd:98 int:01 int:01 modules:02 library:03 configurable:03 perl:03 iter:03 iter:03 let:04 let:04 functions:05 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk 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