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 BAA13496; Wed, 23 Jun 2004 01:32:58 +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 BAA13388 for ; Wed, 23 Jun 2004 01:32:57 +0200 (MET DST) Received: from smtp3.adl2.internode.on.net (smtp3.adl2.internode.on.net [203.16.214.203]) by nez-perce.inria.fr (8.12.10/8.12.10) with ESMTP id i5MNWsEV023869 for ; Wed, 23 Jun 2004 01:32:55 +0200 Received: from [192.168.1.200] (ppp215-31.lns1.syd2.internode.on.net [203.122.215.31]) by smtp3.adl2.internode.on.net (8.12.9/8.12.9) with ESMTP id i5MNWWHY064369; Wed, 23 Jun 2004 09:02:49 +0930 (CST) Subject: Re: [Caml-list] Why must types be always defined at the top level? From: skaller Reply-To: skaller@users.sourceforge.net To: Markus Mottl Cc: Richard Jones , caml-list In-Reply-To: <20040622225321.GB31368@fichte.ai.univie.ac.at> References: <20040622224125.GA24785@redhat.com> <20040622225321.GB31368@fichte.ai.univie.ac.at> Content-Type: text/plain Message-Id: <1087947151.29427.82.camel@pelican.wigram> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 (1.2.2-4) Date: 23 Jun 2004 09:32:32 +1000 Content-Transfer-Encoding: 7bit X-Miltered: at nez-perce with ID 40D8C1A6.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 sourceforge:01 2004:99 struct:01 foo:01 foo:01 module':01 escapes:01 escapes:01 resorting:01 humour:01 intermodule:01 intermodule:01 recursion:01 funcs:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Wed, 2004-06-23 at 08:53, Markus Mottl wrote: > 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? > let f () = > let module M = struct > type t = Foo > end in > M.Foo = M.Foo But t is defined here 'at the top level of a module'. > Note that you cannot return values such that the module name escapes > its scope. Which escapes me. Felix allows types to be defined anywhere and also allows them to escape, it creates no problem I'm aware of (except that you can't name them without resorting to the typeof() operator). I actually think there is some humour here: Topic ---------------------Language X ------------ Language Y Intermodule fun calls Yes No Intermodule type recursion Yes No Nest everything (excl funcs) Yes No Nest funcs No Yes Full sep compil Yes No Platform indep code No Yes One of these languages is an FP, the other is 'a portable assembler'. The portable assembler outperforms the FP on most FP like qualities, but the FP code is actually portable .. [and like Bagley this isn't a serious comparison :] -- John Skaller, mailto:skaller@users.sf.net voice: 061-2-9660-0850, snail: PO BOX 401 Glebe NSW 2037 Australia Checkout the Felix programming language http://felix.sf.net ------------------- 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