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 PAA20491; Fri, 28 Dec 2001 15:19:43 +0100 (MET) 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 PAA20108 for ; Fri, 28 Dec 2001 15:19:42 +0100 (MET) Received: from postfix2-2.free.fr (postfix2-2.free.fr [213.228.0.140]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id fBSEJfP17030 for ; Fri, 28 Dec 2001 15:19:41 +0100 (MET) Received: from free.fr (unknown [213.228.2.8]) by postfix2-2.free.fr (Postfix) with ESMTP id C2B415F85F for ; Fri, 28 Dec 2001 15:19:40 +0100 (CET) Message-ID: <3C2C7FC9.86AD1CA3@free.fr> Date: Fri, 28 Dec 2001 15:20:57 +0100 From: WatchDog Organization: WatchDogs_Company X-Mailer: Mozilla 4.76 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: caml Subject: [Caml-list] Question sur les =?iso-8859-1?Q?r=E9f=E9rences=2E?= Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Bonjour ! Cette petite fonction me pose des problèmes : let resultat (a,b,c,d) position = let pos=ref position in !pos.(d).(c) <- !pos.(b).(a) ; !pos.(b).(a) <- V ; !pos ;; Quel ne fut pas mon étonnement en constatant que cette fonction se permettait de modifier le contenu même de position, alors que je ne l'ai utilisé qu'avec une référence (pos) qui pointait dessus ! Quand on écrit let x = ref 1 in x := !x + 1;; ça ne modifie pas la valeur de l'entier 1, non ??? Merci de votre éclairage. -- "Il faut résister, combattre, affronter la mort. Ainsi l'exige la vérité, la raison." Jean CAVAILLES ------------------- Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr