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 JAA24678; Wed, 28 Mar 2001 09:47:35 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id JAA24673 for caml-list@pauillac.inria.fr; Wed, 28 Mar 2001 09:47:34 +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 IAA05396 for ; Tue, 27 Mar 2001 08:29:51 +0200 (MET DST) Received: from localhost.localdomain (ppp101.dyn142.pacific.net.au [210.23.142.101]) by nez-perce.inria.fr (8.11.1/8.10.0) with ESMTP id f2R6TmT23735 for ; Tue, 27 Mar 2001 08:29:49 +0200 (MET DST) Received: from ozemail.com.au (IDENT:root@localhost [127.0.0.1]) by localhost.localdomain (8.9.3/8.8.7) with ESMTP id QAA20839; Tue, 27 Mar 2001 16:29:08 +1000 Message-ID: <3AC03333.5C6BE4A0@ozemail.com.au> Date: Tue, 27 Mar 2001 16:29:07 +1000 From: John Max Skaller X-Mailer: Mozilla 4.7 [en] (X11; I; Linux 2.2.12-20 i686) X-Accept-Language: en MIME-Version: 1.0 To: Dave Berry CC: Markus Mottl , Chris Hecker , caml-list@inria.fr Subject: Re: [Caml-list] recursive modules redux, & interface files References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Dave Berry wrote: > > Pardon me if this is a dumb question, but what is the difference between > "include" and "open"? Open simply changes the way lookup is done: the 'environment; in which definitions in a module are defined. It doesn't change the interface of the module, or define anything in the module. Include adds the definitions of one module as definitions of another module, more or less saving a lot of typing. (* o.ml *) open List let f = map (* this module contains one symbol, 'f' *) (* i.ml *) include List let f = map (* this module contains 'map', as well as 'f', indeed, everything in 'List' *) (* client.ml *) let _ = O.f .... (* OK *) let _ = O.map .. (* error *) let _ = I.f ... (* OK *) let _ = I.map .. (* OK, synonym for List.map *) In other words, O is a client of List, whereas I is an extension of List. BTW: include was already available for signatures, but not open. Is this right? Can 'open' be made available for signatures? [This would shorten .mli files a lot, make them more readable] -- John (Max) Skaller, mailto:skaller@maxtal.com.au 10/1 Toxteth Rd Glebe NSW 2037 Australia voice: 61-2-9660-0850 checkout Vyper http://Vyper.sourceforge.net download Interscript http://Interscript.sourceforge.net ------------------- To unsubscribe, mail caml-list-request@inria.fr. Archives: http://caml.inria.fr