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 SAA02382; Sat, 27 Mar 2004 18:31:05 +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 SAA02037 for ; Sat, 27 Mar 2004 18:31:03 +0100 (MET) From: briand@aracnet.com Received: from citrine.spiritone.com (citrine.spiritone.com [216.99.193.133]) by nez-perce.inria.fr (8.12.10/8.12.10) with ESMTP id i2RHVfKW014729 for ; Sat, 27 Mar 2004 18:31:42 +0100 Received: from soggy.deldotd.com (216-99-206-32.cust.aracnet.com [216.99.206.32]) by citrine.spiritone.com (8.12.10/8.12.8) with ESMTP id i2RHZmgO015406 for ; Sat, 27 Mar 2004 09:35:49 -0800 Received: from briand by soggy.deldotd.com with local (Exim 3.36 #1 (Debian)) id 1B7He8-0007Kd-00 for ; Sat, 27 Mar 2004 09:31:00 -0800 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16485.47700.498923.656556@soggy.deldotd.com> Date: Sat, 27 Mar 2004 09:31:00 -0800 To: caml-list@inria.fr Subject: [Caml-list] serious type confusion X-Mailer: VM 6.92 under Emacs 21.2.1 X-Miltered: at nez-perce by Joe's j-chkmail ("http://j-chkmail.ensmp.fr")! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; val:01 unit:03 unit:03 coding:03 types:03 scheme:03 let:04 anyway:05 hints:06 brian:06 type:07 type:07 confusion:07 i've:09 isn't:11 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk X-Keywords: X-UID: 393 OK, this is what I get for coding too long in scheme :-) observe the following: # let a=ref [];; val a : '_a list ref = {contents = []} # a := {x=0.;y=0.;z=0.} :: [];; - : unit = () # !a;; - : point list = [{x = 0.; y = 0.; z = 0.}] # a := {x=0.;y=0.;z=0.} :: !a;; - : unit = () # !a ;; - : point list = [{x = 0.; y = 0.; z = 0.}; {x = 0.; y = 0.; z = 0.}] # Exactly as expected ! types aren't so bad after all.. until here : current_polyline := {x=wx; y=wy; z=wz} :: !current_polyline; This expression has type point but is here used with type point list Huh? The first example worked. Oh I see, it's operator precedence, it's assigning the point before doing the concatenation. Oh but wait, it worked in the previous example. I'll try and fix it anyway... current_polyline := ({x=wx; y=wy; z=wz} :: !current_polyline); This expression has type point but is here used with type point list Huh ??? Isn't that impossible ? I've triple checked and current_polyline is always consistently used as a list, and more importantly a point list... Any hints ? Thank You Brian ------------------- 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