Re: subtyping and inheritance

From: Jerome Vouillon (
Date: Wed Jan 27 1999 - 15:18:27 MET

Date: Wed, 27 Jan 1999 15:18:27 +0100
From: Jerome Vouillon <>
To: Markus Mottl <>
Subject: Re: subtyping and inheritance
In-Reply-To: <>; from Markus Mottl on Mon, Jan 25, 1999 at 01:08:30AM +0100

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

This archive was generated by hypermail 2b29 : Sun Jan 02 2000 - 11:58:18 MET