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 PAA24054 for caml-redistribution; Wed, 24 Jul 1996 15:44:36 +0200 Received: (from xleroy@localhost) by pauillac.inria.fr (8.6.10/8.6.6) id LAA22240; Wed, 24 Jul 1996 11:15:50 +0200 From: Xavier Leroy Message-Id: <199607240915.LAA22240@pauillac.inria.fr> Subject: Re: Some questions about the module system... To: fva@ing.uc3m.es Date: Wed, 24 Jul 1996 11:15:50 +0200 (MET DST) Cc: caml-list@pauillac.inria.fr In-Reply-To: <9607221531.AA06681@elrond.uc3m.es> from "Francisco J. Valverde" at Jul 22, 96 05:19:49 pm MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: weis > 1) is there any reason (unclear semantics, scope-holing, etc.) why the O'Caml > module system won't allow an "include " feature? Actually, "include " is available in O'Caml as it was in Caml Special Light. It was a last-minute addition that never got documented, but since it causes no harm and seems to be useful, I'll keep it and document it for the next release. > b) My second question concerns module coercion by means of module signatures. > Sharing constraints between module types is really necessary for code > abstraction, but I found "value aliasing" really useful as well (I don't > know the exact term for the feature so I will describe it). The only coercions that can be performed with a signature constraint (str : sig) are restrictions, i.e. hide components or make their type info less precise. I doubt renaming of structure components has its place there. But it's easy (and just as efficient) to do the coercion yourself, e.g.: module Node = struct type node let less_depth = ... let less_dist = ... ... end module DepthFirstPQueue = MakePQueue (struct type t = Node.node let leq = Node.less_depth end) module BestFirstPQueue = MakePQueue (struct type t = Node.node let leq = Node.less_dist end) Regards, - Xavier Leroy