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 IAA20645; Fri, 9 Aug 2002 08:43:22 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id IAA20777 for ; Fri, 9 Aug 2002 08:43:22 +0200 (MET DST) Received: from grisu.bik-gmbh.de (grisu.bik-gmbh.de [194.233.237.82]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id g796hLr07073 for ; Fri, 9 Aug 2002 08:43:21 +0200 (MET DST) Received: from hars.de (prony.bik-gmbh.de [194.233.237.133]) by grisu.bik-gmbh.de (8.12.3/8.11.1) with ESMTP id g796hKAK059120; Fri, 9 Aug 2002 08:43:20 +0200 (CEST) (envelope-from florian@hars.de) Message-ID: <3D536483.4090103@hars.de> Date: Fri, 09 Aug 2002 08:43:15 +0200 From: Florian Hars User-Agent: Mozilla/5.0 (X11; U; Linux i686; de-AT; rv:1.0.0) Gecko/20020529 X-Accept-Language: de-de, en-us, en MIME-Version: 1.0 To: "Nicolas FRANCOIS (AKA El Bofo)" CC: Caml List Subject: Re: [Caml-list] Side effect References: <20020809004020.1dace6b2.nicolas.francois@free.fr> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Nicolas FRANCOIS (AKA El Bofo) wrote: > So matrix m was modified. But I work on a copy of m in > Pivot_Z.pivot_ligne_sans_echange. What's the problem doc ? Yes, m' is a copy of m, but the elements of m are arrays, so the copy m' contains references to the same arrays that m contains, so m.(i).(j) is the same cell as m'.(i).(j). See: Objective Caml version 3.04 # let m = [|[|1;2|];[|3;4|]|];; val m : int array array = [|[|1; 2|]; [|3; 4|]|] # let m' = Array.copy m;; val m' : int array array = [|[|1; 2|]; [|3; 4|]|] # m'.(1).(1)<-99;; - : unit = () # m';; - : int array array = [|[|1; 2|]; [|3; 99|]|] # m;; - : int array array = [|[|1; 2|]; [|3; 99|]|] # m'.(1) <- [|0;0|];; - : unit = () # m' ;; - : int array array = [|[|1; 2|]; [|0; 0|]|] # m;; - : int array array = [|[|1; 2|]; [|3; 99|]|] # Yours, Florian. ------------------- 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