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 KAA20454; Tue, 30 Jul 2002 10:15:36 +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 KAA20285 for ; Tue, 30 Jul 2002 10:15:35 +0200 (MET DST) Received: from laurelin.dementia.org ([208.167.88.73]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id g6U8FXj22153; Tue, 30 Jul 2002 10:15:34 +0200 (MET DST) Received: by laurelin.dementia.org (Postfix, from userid 1001) id C014E70CA; Tue, 30 Jul 2002 04:22:47 -0400 (EDT) To: Xavier Leroy Cc: John Prevost , Caml-list Subject: Re: [Caml-list] Serious typechecking error involving new polymorphism (crash) References: <20020729144527.A30919@pauillac.inria.fr> <000f01c2377c$36263060$2097fea9@janxp> <86vg6xlktk.fsf_-_@laurelin.dementia.org> <20020730095833.B6564@pauillac.inria.fr> From: John Prevost Date: 30 Jul 2002 04:22:47 -0400 (34.916 UMT) In-Reply-To: <20020730095833.B6564@pauillac.inria.fr> Message-ID: <86ofcplj54.fsf@laurelin.dementia.org> User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk >>>>> "xl" == Xavier Leroy writes: xl> Yes, this is a serious bug with polymorphic methods and xl> fields. Expect a 3.06 release as soon as it is fixed. In the xl> meantime, you're welcome to experiment with polymorphic xl> methods and fields, but don't bet the farm on them... Polymorphic methods should be safe, as far as I can tell, since method calls provide natural points of polymorphism, and storage in the class is not allowed to be polymorphic. (That is, you can't pull the same trick with an object because you can't store a polymorphic value to be shared across multiple results from a method call, and any insufficiently polymorphic value returned from a polymorphic method call is caught.) Can you share any plans for polymorphic records? I can see no way to make them safe except to restrict the contents to function values (which prevents the use of abstract types which are safe, but is survivable) or to extend the system so that any value may be polymorphic. (Which would then allow for the two argument types of := to be checked to see if they're equally polymorphic.) I presume this second option might complicate typechecking dramatically, though. Otherwise, why avoid it? (You can always use a struct wrapper on the value at the moment to get the desired effect--to make a list of map-type functions, for example.) John. ------------------- 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