Version française
Home     About     Download     Resources     Contact us    
Browse thread
Re: subtyping and inheritance
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Jerome Vouillon <Jerome.Vouillon@i...>
Subject: Re: subtyping and inheritance
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