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 SAA14254 for caml-redistribution; Sat, 29 Aug 1998 18:48:04 +0200 (MET DST) 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 KAA21441 for ; Wed, 26 Aug 1998 10:30:13 +0200 (MET DST) Received: from julie.univ-savoie.fr (univax.univ-savoie.fr [193.48.120.32]) by nez-perce.inria.fr (8.8.7/8.8.7) with ESMTP id KAA26358 for ; Wed, 26 Aug 1998 10:30:12 +0200 (MET DST) Received: from univ-savoie.fr (raffalli@bppp4.univ-savoie.fr [193.48.120.23]) by julie.univ-savoie.fr (8.9.0/jtpda-5.2) with ESMTP id KAA02525 for ; Wed, 26 Aug 1998 10:31:42 +0200 (MET DST) Sender: weis Message-ID: <35E3C6E9.BAFFE611@univ-savoie.fr> Date: Wed, 26 Aug 1998 10:27:21 +0200 From: Christophe Raffalli Organization: Université de Savoie X-Mailer: Mozilla 4.04 [en] (X11; I; Linux 2.0.33 i686) MIME-Version: 1.0 To: caml-list@inria.fr Subject: inheritance for functor ? Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit The "open" feature for module and module type does not add any construtor to a module. It would be nice to also have an "inherit" or "import" constructor that would add all the constructor of a module to the current module. Here si an example: I could write this: module type Ring = sig type t (*les elemnets de l'anneau seront de type t*) val zero : t (*definition de l'element nul*) val one : t (*definition de l'unite*) val t_of_int : int -> t val (++) : t -> t -> t (*definition de la somme pour l'anneau*) val (--) : t -> t -> t (*definition de la soustraction*) val ( ** ) : t -> t -> t (*definition de la multiplication*) val (==) : t -> t -> bool val opp: t -> t val print : t -> unit end module type Field = sig import Ring val (//) : t -> t -> t end module type Euclidian_Ring = sig import Ring type nt val norm : t -> nt val leq : nt -> nt -> bool val (//) : t -> t -> t val (mod) : t -> t -> t val div_mod : t -> t -> t * t end This feature reflects more the intention of the programmer. -- Christophe Raffalli Laboratoire de Mathématique / LAMA Université de Savoie UFR SFA, Campus Scientifique 73376, Le Bourget du Lac CEDEX, FRANCE. URL: http://www.logique.jussieu.fr/www.raffalli email: Christophe.Raffalli@univ-savoie.fr