From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 31603BC88 for ; Sun, 6 Feb 2005 03:56:47 +0100 (CET) Received: from smtp3.adl2.internode.on.net (smtp3.adl2.internode.on.net [203.16.214.203]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id j162ujhc022742 for ; Sun, 6 Feb 2005 03:56:46 +0100 Received: from [192.168.1.200] (ppp212-197.lns2.syd3.internode.on.net [203.122.212.197]) by smtp3.adl2.internode.on.net (8.12.9/8.12.9) with ESMTP id j162uPKd020539; Sun, 6 Feb 2005 13:26:36 +1030 (CST) Subject: Re: Why can't types and exceptions be nested (was: Re: [Caml-list] Estimating the size of the ocaml community) From: skaller Reply-To: skaller@users.sourceforge.net To: Richard Jones Cc: caml-list@yquem.inria.fr In-Reply-To: <20050205163732.GA13169@furbychan.cocan.org> References: <8008871f05020213362d21ba87@mail.gmail.com> <000f01c50971$baad4840$0100a8c0@mshome.net> <1107403128.32586.223.camel@pelican.wigram> <20050203173556.4acec1c5.ocaml-erikd@mega-nerd.com> <009a01c50a1e$f6c92080$0100a8c0@mshome.net> <20050204103006.GA498@first.in-berlin.de> <20050205131418.GC484@first.in-berlin.de> <20050205163732.GA13169@furbychan.cocan.org> Content-Type: text/plain Organization: Message-Id: <1107658585.4797.137.camel@pelican.wigram> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 (1.2.2-4) Date: 06 Feb 2005 13:56:25 +1100 Content-Transfer-Encoding: 7bit X-Miltered: at concorde with ID 4205876D.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 ocaml:01 sourceforge:01 wrote:01 ocaml:01 namespaces:01 glebe:01 061:98 nsw:01 exceptions:01 exceptions:01 functions:01 functions:01 modules:01 snail:02 X-Spam-Checker-Version: SpamAssassin 3.0.2 (2004-11-16) on yquem.inria.fr X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.2 X-Spam-Level: On Sun, 2005-02-06 at 03:37, Richard Jones wrote: > Is there a reason why types (and exceptions) can't appear nested? This kind of lack of transparency is annoying. The main reason is probably historical.. Felix allows anything to be nested anywhere, modules, type definitions, etc can all be put inside functions, it uses a unified namespace like C++. [You can even put expressions inside types, using the 'typeof()' operator] Ocaml has separate namespaces for types and variables. A module wraps both, which is why you actually CAN nest types in functions in Ocaml, but you have to use a local module to do it. A new feature added to solve the problem you mention, although not entirely transparently. Whilst this kind of quirkery is annoying, that's about all it is -- annoying. It isn't really a show stopper. -- 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