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 49DC4BBAF for ; Fri, 21 Jul 2006 14:01:24 +0200 (CEST) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by nez-perce.inria.fr (8.13.6/8.13.6) with ESMTP id k6LC1O1g022085 for ; Fri, 21 Jul 2006 14:01:24 +0200 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 OAA19108 for ; Fri, 21 Jul 2006 14:01:23 +0200 (MET DST) Received: from ext.lri.fr (ext.lri.fr [129.175.15.4]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id k6LC1NEN013052 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 21 Jul 2006 14:01:23 +0200 Received: from smtp.lri.fr (serveur3-5 [129.175.3.5]) by ext.lri.fr (Postfix) with ESMTP id 156932021C9; Fri, 21 Jul 2006 14:01:23 +0200 (CEST) Received: from pc9-152.lri.fr (pc9-152 [129.175.9.152]) by smtp.lri.fr (Postfix) with ESMTP id 216A3CED9B; Fri, 21 Jul 2006 14:01:22 +0200 (CEST) Received: from filliatr by pc9-152.lri.fr with local (Exim 4.60) (envelope-from ) id 1G3th8-0001YX-NL; Fri, 21 Jul 2006 14:01:26 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <17600.49686.673895.1832@pc9-152.lri.fr> Date: Fri, 21 Jul 2006 14:01:26 +0200 To: Jozef Kosoru Cc: caml-list@inria.fr Subject: Re: [Caml-list] How to define submodules In-Reply-To: <20060721115325.GS3653@osiris.uid0.sk> References: <20060721115325.GS3653@osiris.uid0.sk> X-Mailer: VM 7.19 under Emacs 21.4.1 From: Jean-Christophe Filliatre X-Virus-Scanned: by amavisd-new at lri.fr X-Miltered: at nez-perce with ID 44C0C214.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at concorde with ID 44C0C213.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; submodules:01 filliatre:01 filliatr:01 lri:01 ocamlc:01 parser:01 ocamlc:01 parser:01 cmo:01 compiler:01 cmi:01 ocaml:01 -pack:01 -for-pack:01 compiler: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=none autolearn=disabled version=3.0.3 Jozef Kosoru writes: > OK, and then I want to compile it (within a root directory): > > $ ocamlc -c Kernel/Parser/pdf.ml > $ ocamlc -I . Kernel/Parser/pdf.cmo main.ml -o app > > File "main.ml", line 1, characters 0-22: > Unbound value Kernel.Parser.Pdf.init > > Is this supposed to work somehow? No. First, to compile main.ml you need to pass "-I Kernel/Parser" to the compiler, because it needs to find the file pdf.cmi. Second, in main.ml you have to write "Pdf.init" instead of "Kernel.Parser.Pdf.init" because the directory structure is not turned into a module structure in ocaml. However, you can use the option -pack and -for-pack of the compiler to pack several files as submodules of a new module; see the manual at http://caml.inria.fr/pub/docs/manual-ocaml/manual025.html -- Jean-Christophe