From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from weis@localhost) by pauillac.inria.fr (8.6.10/8.6.6) id TAA27522 for caml-redistribution; Fri, 14 Jun 1996 19:24:48 +0200 Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.6.10/8.6.6) with ESMTP id RAA00981 for ; Fri, 14 Jun 1996 17:45:26 +0200 Received: from lorraine.loria.fr (lorraine.loria.fr [152.81.1.17]) by concorde.inria.fr (8.7.1/8.7.1) with ESMTP id RAA16061 for ; Fri, 14 Jun 1996 17:45:26 +0200 (MET DST) Received: from delsarte.loria.fr (delsarte.loria.fr [152.81.6.130]) by lorraine.loria.fr (8.7.5/8.7.3/JCG) with ESMTP id RAA01717; Fri, 14 Jun 1996 17:45:23 +0200 (MET DST) From: Bouzid Djamila Received: (from bouzidd@localhost) by delsarte.loria.fr (8.7.4/8.7.3) id RAA19033; Fri, 14 Jun 1996 17:45:24 +0200 (MET DST) Message-Id: <199606141545.RAA19033@delsarte.loria.fr> Subject: Re: Probleme d'interface To: lux@heidelbg.ibm.com (Wolfgang Lux) Date: Fri, 14 Jun 1996 17:45:23 +0200 (MET DST) Cc: caml-list@pauillac.inria.fr In-Reply-To: <9606140921.AA32629@idse.heidelbg.ibm.com> from "Wolfgang Lux" at Jun 14, 96 11:21:04 am X-Mailer: ELM [version 2.4 PL25] MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Sender: weis Hi! Thanks for all responses that I have received. > The problem simply is, that you have to define both modules types > VENDOR_INTEGER and VENDOR in vendor.ml as well to compile. So I have mixed vendor.mli and vendor.ml in a single file vendor.ml. (* vendor.ml *) module type VENDOR_INTEGER = sig val min : int * int -> int end (* sig *) module type VENDOR = sig val print: string -> unit (* Flush the standard out. *) module Integer : VENDOR_INTEGER end (* sig *) module type TIMINGBOARD = sig end module V (TimingBoard: TIMINGBOARD) : VENDOR = struct let print = print_string module Integer : VENDOR_INTEGER = struct let min(x,y) = if x < y then x else y end end (* functor V *) (*end of vendor.ml) So the compilation is finot ip 61 % cslc vendor.ml I/O error: vendor.cmi: No such file or directory finot ip 62 % What means this error, if vendor.cmi is generated in compilation. > But actually this is not what you really want, as the local module V > is not visible at all outside of vendor.ml! (And in contrary to your > comment it is not a functor!) I have'nt inderstood why module V is not visible at all outside in this case of vendor.ml. ^^^ > > If you look into the Caml Special Light reference, please, could you tell me where can I find this reference ? I have only Caml Special Light reference manual, I want to have more references of this language. you will see that > the files vendor.mli and vendor.ml constitute themselves a module > which is roughly equivalent to > > module Vendor : > sig > <> > end = > struct > <> > end > > So you wanted probably to write the following module interface vendor.mli: > > module type VENDOR_INTEGER = > sig > val min : int * int -> int > end (* sig *) > > val print: string -> unit > module Integer : VENDOR_INTEGER > > And your implementation vendor.ml then would look as follows: > > module type VENDOR_INTEGER = > sig > val min : int * int -> int > end > > let print = print_string > module Integer : VENDOR_INTEGER = > struct > let min ((x:int),(y:int)) = if x < y then x else y > end > But if we want have module V : VENDOR = ....... end (*V*) module V1 = V module V2 = V or module V (....) : VENDOR = struct ...... end (*functor*) What should I do ? > > Hope this helps, Thanks a lot. D. Bouzid.