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 VAA01619 for caml-redistribution; Thu, 28 Jan 1999 21:00:24 +0100 (MET) 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 UAA31349 for ; Thu, 28 Jan 1999 20:40:07 +0100 (MET) Received: from irritatie.cs.kun.nl (irritatie.cs.kun.nl [131.174.33.129]) by nez-perce.inria.fr (8.8.7/8.8.7) with ESMTP id UAA18555 for ; Thu, 28 Jan 1999 20:40:06 +0100 (MET) Received: (from tews@localhost) by irritatie.cs.kun.nl (8.8.7/8.8.7) id UAA01127; Thu, 28 Jan 1999 20:40:48 +0100 Date: Thu, 28 Jan 1999 20:40:48 +0100 Message-Id: <199901281940.UAA01127@irritatie.cs.kun.nl> From: Hendrik Tews MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: caml-list@inria.fr Subject: Re: subtyping and inheritance In-Reply-To: <19990127151827.16711@pauillac.inria.fr> References: <199901201150.MAA09911@irritatie.cs.kun.nl> <199901250008.BAA29432@miss.wu-wien.ac.at> <19990127151827.16711@pauillac.inria.fr> X-Mailer: VM 6.22 under 19.15 XEmacs Lucid Sender: weis Hi, I don't know how method dispatch is implemented in ocaml. I was also not able to find a reference about that (is their such?). Therefore the following is based on some speculation. From: Jerome Vouillon Date: Wed, 27 Jan 1999 15:18:27 +0100 Subject: Re: subtyping and inheritance [concerning covariant method specialization] 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. But also in ocaml you choose the method depending on the dynamic type of object to which it is applied (otherwise late binding could never work). You only had to repeat this process for all the arguments of the method which are declared for covariant specialization. The absence of dynamic types applies only to arguments which are not objects. But since other types (than object types) cannot be related by the subtype relation, covariant specialization would never apply for such arguments. Surly, there would be some difficulties to integrate this feature. But compare that with the gain! Compare those clumsy solutions to Markus' problem with the ease of simly overriding the binary method! Being able to really use binary methods in a type safe environment would IMHO be worth a lot of effort. Bye, Hendrik