Date: Sun, 7 Nov 1999 11:37:12 +0100
From: Christian RINDERKNECHT <rinderkn@hugo.int-evry.fr>
To: Jerome Vouillon <Jerome.Vouillon@inria.fr>
Subject: Re: [Q] Four micro-questions on objects and modules.
In-Reply-To: <19991103224029.11296@pauillac.inria.fr>; from Jerome Vouillon on Wed, Nov 03, 1999 at 10:40:29PM +0100
Hello,
> > 3) Would it be possible to allow the "include" feature in class
> > types?
>
> What do you mean ? A class type can inherit from another class type :
> class type c = object method m : int end
> class type d = object inherit c method n : bool end
Okay. This is exactly what I was asking for. But... now I am a little
bit confused since I was used to think that inheritance was a concept
that applies to classes, and (sub)typing to class types. Could you
explain? (Please note I am new to these topics...)
It may be not related, but the toplevel does not print out the "inherit"
construct after the typing of the classes:
Objective Caml version 2.02
# class x =
object
method m = ()
end
;;
class x : object method m : unit end
# class y =
object
inherit x
method n = ()
end
;;
class y : object method m : unit method n : unit end
^^^^^^^^^^^^^^^
No "inherit x" used instead here...
Best regards,
--Christian
----------------------------------------------------------------------- Christian Rinderknecht Phone +33 (0)1 60 76 44 43 Institut National des Télécommunications Fax +33 (0)1 60 76 47 11 Département Logiciels Réseaux (LOR) WWW 9, Rue Charles Fourier, F-91011 Évry Cedex
This archive was generated by hypermail 2b29 : Sun Jan 02 2000 - 11:58:28 MET