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 AAA10737; Wed, 23 Jun 2004 00:53:55 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f 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 AAA10747 for ; Wed, 23 Jun 2004 00:53:54 +0200 (MET DST) Received: from fichte.ai.univie.ac.at (fichte.ai.univie.ac.at [131.130.174.156]) by nez-perce.inria.fr (8.12.10/8.12.10) with ESMTP id i5MMrrEV019447 for ; Wed, 23 Jun 2004 00:53:53 +0200 Received: from fichte.ai.univie.ac.at (markus@localhost [127.0.0.1]) by fichte.ai.univie.ac.at (8.12.3/8.12.3/Debian-6.6) with ESMTP id i5MMrMDu031958; Wed, 23 Jun 2004 00:53:22 +0200 Received: (from markus@localhost) by fichte.ai.univie.ac.at (8.12.3/8.12.3/Debian-6.6) id i5MMrLOC031957; Wed, 23 Jun 2004 00:53:21 +0200 Date: Wed, 23 Jun 2004 00:53:21 +0200 From: Markus Mottl To: Richard Jones Cc: caml-list@inria.fr Subject: Re: [Caml-list] Why must types be always defined at the top level? Message-ID: <20040622225321.GB31368@fichte.ai.univie.ac.at> Mail-Followup-To: Richard Jones , caml-list@inria.fr References: <20040622224125.GA24785@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040622224125.GA24785@redhat.com> User-Agent: Mutt/1.4.1i X-Miltered: at nez-perce with ID 40D8B881.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 struct:01 foo:01 foo:01 escapes:01 mottl:02 mottl:02 modules:02 nested:02 module:03 module:03 wrote:03 types:03 types:03 markus:04 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Tue, 22 Jun 2004, Richard Jones wrote: > The subject says it all really. Why do types need to be defined at > the top level of a module? Why isn't it possible to define them in > some nested scope? But it is (using local modules): let f () = let module M = struct type t = Foo end in M.Foo = M.Foo Note that you cannot return values such that the module name escapes its scope. Regards, Markus -- Markus Mottl http://www.oefai.at/~markus markus@oefai.at ------------------- 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