From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id WAA00411; Thu, 18 Apr 2002 22:55:53 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id WAA00407 for ; Thu, 18 Apr 2002 22:55:52 +0200 (MET DST) Received: from sunny.pacific.net.au (sunny.pacific.net.au [203.25.148.40]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id g3IKtnb13495; Thu, 18 Apr 2002 22:55:49 +0200 (MET DST) Received: from wisma.pacific.net.au (wisma.pacific.net.au [210.23.129.72]) by sunny.pacific.net.au with ESMTP id g3IKthXt024570; Fri, 19 Apr 2002 06:55:43 +1000 (EST) Received: from ozemail.com.au (ppp185.dyn71.pacific.net.au [202.7.71.185]) by wisma.pacific.net.au with ESMTP id GAA09933; Fri, 19 Apr 2002 06:55:41 +1000 (EST) Message-ID: <3CBF32CC.3030806@ozemail.com.au> Date: Fri, 19 Apr 2002 06:55:40 +1000 From: John Max Skaller User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.2.1) Gecko/20010901 X-Accept-Language: en-us MIME-Version: 1.0 To: Warp CC: Tom Hirschowitz , OCaml Subject: Re: [Caml-list] Modules Order References: <00a501c1e6e1$8c910970$3900a8c0@warp> <15550.55633.886446.494339@paille.inria.fr> <004201c1e6e7$2300e6a0$3900a8c0@warp> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Warp wrote: > >The problem here is that we don't know if we're using either only types or >functions from the other module. > One solution to that is to build interfaces containing types with no corresponding implementation file. Then if you use a name X for which there is an X.mli but no X.ml, you're only using types. This seems like a good policy in general, it is more robust, since there is no need to keep a duplicated ml and mli file. Ocaml's ability to process a .mli file with no corresponding .ml file doesn't appear to be documented... it works for the native code compiler, don't know about the bytecode compiler. If a type is only used locally, the requirement can be relaxed: in such cases, by specification, some functions must be used too, so the type can be included in the .ml and mli files. BTW: the big pain here is functors: using ocamlc -i to generate an expanded interface for a fuctor application is really horrible and rarely works properly (you have to edit the output to replace expanded definitions with aliases to have any hope of reading it). Is there a better way? -- John Max Skaller, mailto:skaller@ozemail.com.au snail:10/1 Toxteth Rd, Glebe, NSW 2037, Australia. voice:61-2-9660-0850 ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners