From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id E2665D45F for ; Wed, 2 Nov 2005 03:03:46 +0100 (CET) Received: from zproxy.gmail.com (zproxy.gmail.com [64.233.162.201]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id jA223k5g019977 for ; Wed, 2 Nov 2005 03:03:46 +0100 Received: by zproxy.gmail.com with SMTP id o1so15013nzf for ; Tue, 01 Nov 2005 18:03:45 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=PetC4m6+XmZV0GGexRCsGzvDpYjL61HsLLKKRziuzNU0bIMKfIHSoBYY2867C/X1ig/6G5Aoih872VxWd8WjZ6cPEPUE88nOJm+ozTxZsK7eFoG1o7C+5qIuUuec91FqA1t0pRx/QQeMKzhKz+lMwOIJkOFbSZZMbciyR2RwzHI= Received: by 10.36.160.8 with SMTP id i8mr665887nze; Tue, 01 Nov 2005 18:03:45 -0800 (PST) Received: by 10.37.18.80 with HTTP; Tue, 1 Nov 2005 18:03:45 -0800 (PST) Message-ID: <875c7e070511011803x598ffb63gd54267aec1fb181e@mail.gmail.com> Date: Tue, 1 Nov 2005 21:03:45 -0500 From: Chris King To: Tom Hawkins Subject: Re: [Caml-list] Nesting Modules Cc: caml-list@yquem.inria.fr In-Reply-To: <43679EEF.70102@confluent.org> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <43679EEF.70102@confluent.org> X-Miltered: at nez-perce with ID 43681E82.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 nesting:01 cmo:01 -pack:01 ocamlc:01 -pack:01 foo:01 cmo:01 foo:01 wrote:01 essentially:01 modules:01 modules:01 referenced:01 defined:01 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_BY_IP autolearn=disabled version=3.0.3 On 11/1/05, Tom Hawkins wrote: > Is it possible to nest modules defined in separate files? One way to do what you're looking to do, is to write in top.ml: module Bottom =3D Bottom This will essentially re-export Bottom in Top. Unfortunately, this requires that you link bottom.cmo in with your code, which causes Bottom to be visible at the top level. A similar effect can be obtained with the -pack flag: ocamlc -pack top.ml bottom.ml foo.cmo Top and Bottom can now be referenced as Foo.Top and Foo.Bottom, and only foo.cmo needs to be linked. I know this isn't exactly what you're looking for, but it might do the trick just the same. - Chris King