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 CAA05342; Wed, 24 Apr 2002 02:36:57 +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 CAA05255 for ; Wed, 24 Apr 2002 02:36:56 +0200 (MET DST) Received: from sunny.pacific.net.au (sunny.pacific.net.au [203.25.148.40]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id g3O0asv20241 for ; Wed, 24 Apr 2002 02:36:54 +0200 (MET DST) Received: from wisma.pacific.net.au (wisma.pacific.net.au [210.23.129.72]) by sunny.pacific.net.au with ESMTP id g3O0aqXt012763; Wed, 24 Apr 2002 10:36:52 +1000 (EST) Received: from ozemail.com.au (ppp59.dyn146.pacific.net.au [210.23.146.59]) by wisma.pacific.net.au with ESMTP id KAA11199; Wed, 24 Apr 2002 10:36:50 +1000 (EST) Message-ID: <3CC5FE21.3050206@ozemail.com.au> Date: Wed, 24 Apr 2002 10:36:49 +1000 From: John Max Skaller User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.2.1) Gecko/20010901 X-Accept-Language: en-us MIME-Version: 1.0 To: Frederic Tronel CC: caml-list@inria.fr Subject: Re: [Caml-list] Problem with parametric classes References: <3CC3CD45.E6D6E166@inrialpes.fr> <3CC47B27.7080308@ozemail.com.au> <3CC50FF4.E1B0AA5@inrialpes.fr> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Frederic Tronel wrote: >> >>That seems suspicious .. countingObjects is generic >>here .. this is at global scope .. the initialiser >>which fixes the type is inside a class .. >>this has to be wrong .. >> > >Why not ? >This code has worked for a long time, before I decided to add some >features (synchroAccounting class). > Because the type of a global is being fixed by an implementation detail of a class .. classes are supposed to encapsulate things. If it worked before, it might be considered a bug in the ocaml type checker: type inference shouldn't cross class boundaries like that. In any case .. you have a global, and that is bad enough. It should be passed as an argument to methods that use it, including the initialiser. -- John Max Skaller, mailto:skaller@ozemail.com.au snail:10/1 Toxteth Rd, Glebe, NSW 2037, Australia. voice:61-2-9660-0850 ------------------- 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