Version française
Home     About     Download     Resources     Contact us    
Browse thread
RE: [Caml-list] Namespace proposal
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: james woodyatt <jhw@w...>
Subject: Re: [Caml-list] Namespace proposal: XML variant
On Friday, Aug 30, 2002, at 13:25 US/Pacific, Jeffrey Palmer wrote:
> On Friday 30 August 2002 01:02 pm, Alessandro Baretta wrote:
>>
>> I propose to add an optional namespace construct to
>> explicitly associate namespace URIs with namespace names.
>
> Please, let's not entertain any of the rampant stupidity that the W3C 
> seems so
> mired in. I've always thought that the concept of using URIs for 
> namespaces,
> parameter settings, etc., was the most ridiculous thing I've ever 
> seen. [...]

A more constructive way to say this might be to observe that any syntax 
for a global namespace of Objective Caml types and values could be 
transformed into a URN by simply publishing an Internet RFC that 
defined the syntax for the namespace specific string, according to the 
requirements of RFC 2141.

It would seem desirable to choose a namespace syntax that lends itself 
easily to encoding in a URN.

Here's another strawman for discussion.

-----

The obvious choice for a namespace identifier is "ocaml" and this would 
produce URN's of the following form:

	<urn:ocaml:some:hierarchy:YourModuleHere.your_type_or_value>

I chose a ':' character to separate levels in the namespace hierarchy 
arbitrarily.  Other characters like '/' or '.' could easily be 
considered as well.

In this example, you could imagine that the compiler could be invoked 
with a namespace flag, like so:

	ocamlc -N :some:hierarchy -c yourModuleHere.ml -o yourModuleHere.cmo

You could then define a language construct that looks kinda like the 
following:

	namespace N = :some:hierarchy
	module M = N:YourModuleHere

The 'namespace' keyword would define an alias for a prefix to the 
modules in some part of the global namespace, and it would be used in a 
straightforward way as shown above to construct the names of externally 
defined module types.

The namespace would be encoded in the .cmi and .cmo files, and the tool 
chain would need to respect them as it searched for signatures and 
modules to reference.


-- 
j h woodyatt <jhw@wetware.com>
markets are only free to the people who own them.

-------------------
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