From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id TAA10277 for caml-redistribution; Wed, 27 Jan 1999 19:28:30 +0100 (MET) 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 PAA11892 for ; Wed, 27 Jan 1999 15:18:31 +0100 (MET) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.8.7/8.8.7) with ESMTP id PAA23769; Wed, 27 Jan 1999 15:18:27 +0100 (MET) Received: (from vouillon@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id PAA23631; Wed, 27 Jan 1999 15:18:27 +0100 (MET) Message-ID: <19990127151827.16711@pauillac.inria.fr> Date: Wed, 27 Jan 1999 15:18:27 +0100 From: Jerome Vouillon To: Markus Mottl Cc: OCAML Subject: Re: subtyping and inheritance References: <199901201150.MAA09911@irritatie.cs.kun.nl> <199901250008.BAA29432@miss.wu-wien.ac.at> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Mailer: Mutt 0.89.1 In-Reply-To: <199901250008.BAA29432@miss.wu-wien.ac.at>; from Markus Mottl on Mon, Jan 25, 1999 at 01:08:30AM +0100 Sender: weis On Mon, Jan 25, 1999 at 01:08:30AM +0100, Markus Mottl wrote: [...] > So far it seems that things would be unsafe with covariance. But now, > Castagna answers my (former) question, whether making "reappear" methods > from ancestors would be safe: it is... > > The paper looked difficult at first, but turned out to be surprisingly > easy to read: Castagna makes the theorie very intuitively clear with his > examples of classes "2DPoint" and "3DPoint" and how methods are chosen > in the different models. > > The record based method (as found in OCAML - the object (record) > determines, which method is selected, arguments are not considered) > can be obviously extended to support covariance. However, it is not possible to apply this extension to Ocaml. Indeed, it requires that methods are chosen depending on the dynamic type of their arguments. But this information is not available in Ocaml. There are also difficulties for type inference. -- Jérôme