caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Alessandro Baretta <alex@baretta.com>
To: Ocaml <caml-list@inria.fr>
Subject: Re: [Caml-list] Namespace proposal: XML variant
Date: Fri, 30 Aug 2002 20:02:34 +0200	[thread overview]
Message-ID: <3D6FB33A.9020000@baretta.com> (raw)
In-Reply-To: <3D5FD3DF.60706@ozemail.com.au>

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


  reply	other threads:[~2002-08-30 17:54 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-08-15 16:21 [Caml-list] Namespace proposal Gurr, David (MED, self)
2002-08-15 17:00 ` Vitaly Lugovsky
2002-08-15 21:08   ` [Caml-list] " Michaël Grünewald
2002-08-18 17:05 ` [Caml-list] " John Max Skaller
2002-08-30 18:02   ` Alessandro Baretta [this message]
2002-08-30 20:25     ` [Caml-list] Namespace proposal: XML variant Jeffrey Palmer
2002-08-30 22:39       ` james woodyatt
2002-08-30 22:51       ` Blair Zajac

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3D6FB33A.9020000@baretta.com \
    --to=alex@baretta.com \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).