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 TAA13311; Fri, 30 Aug 2002 19:54:19 +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 TAA13547 for ; Fri, 30 Aug 2002 19:54:19 +0200 (MET DST) X-SPAM-Warning: Sending machine is listed in blackholes.five-ten-sg.com Received: from athlon.baretta.com (r-mi214-6a144.tin.it [62.211.4.144]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id g7UHsHD27669 for ; Fri, 30 Aug 2002 19:54:17 +0200 (MET DST) Received: from baretta.com (localhost.localdomain [127.0.0.1]) by athlon.baretta.com (Postfix) with ESMTP id 1D39E273C5 for ; Fri, 30 Aug 2002 20:02:34 +0200 (CEST) Message-ID: <3D6FB33A.9020000@baretta.com> Date: Fri, 30 Aug 2002 20:02:34 +0200 From: Alessandro Baretta Organization: Baretta srl -- www.baretta.com User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.0) Gecko/20020529 X-Accept-Language: it, en MIME-Version: 1.0 To: Ocaml Subject: Re: [Caml-list] Namespace proposal: XML variant References: <3D5FD3DF.60706@ozemail.com.au> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk I thoroughly dislike any "package ~= directory" solution, yet I think a namespace construct should be present in the language in order to allow interoperability between different projects with different naming conventions. I propose a scheme à la XML, where namespaces are URIs belonging to the person or organization which releases the associated code. I propose to add an optional namespace construct to explicitly associate namespace URIs with namespace names. namespace MyBigProject = "http://alexbaretta.com/big_project/" module Foobar in MyBigProject = ... When I want to use somebody else's code I code just define a namespace name. Consider, for example, that I need to use Pxp in my project. Nowadays, I'd have to write open Pxp_document open Pxp_yacc With my scheme I'd write namespace Pxp = "http://www.ocaml-programming.de/programming/pxp.html" (* or whatever URI Gerd might choose. *) open Document in Pxp; open Yacc in Pxp; (* Assuming Gerd would adopt this namespace scheme *) This is very very similar to the approach taken by XML. I think this is the model we should refer to when discussing a namespace scheme for OCaml. This technique only serves the purpose of avoiding name clashes between modules: every module name lives within the namespace belonging to and defined by the author. No assumptions are made w/respect to directory structure. Yet, the build evironment, with some help from such a program as ocamldep, could extract information from the namespace URIs and use it as a hint for source file search. Yet, harnessing URI for the sake of filename resolution would be entirely optional and delegated to the build environment. I hope to get some feedback on this proposal. What do you guys think about it? Alex ------------------- 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