caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* About namespaces
@ 2008-11-20 21:29 David Rajchenbach-Teller
  2008-11-20 21:57 ` [Caml-list] " Christophe Raffalli
  2008-11-22 19:30 ` Ashish Agarwal
  0 siblings, 2 replies; 4+ messages in thread
From: David Rajchenbach-Teller @ 2008-11-20 21:29 UTC (permalink / raw)
  To: Caml

At the moment, there is no difference between modules and namespaces.
Among other things, this means that if I write an extension MyList to
List and someone else writes and extension HisList to List, there is no
automated way to merge these, I need to write yet another module
LatestList to be able to use both extensions at the same time. While
this is certainly possible, it's also quite clumsy and prevents drop-in
additions to existing modules (or hierarchies, yes) by third-party
libraries, something which, as Richard Jones points out, may be
important.

All of this is due to the fact that modules are closed: once a module
has been written, there is no way to add something to that module
without altering the source code or writing a new module.

Now, David Allsopp suggested (off-list) that we could perhaps implement
namespaces as a Camlp4 extension, with the use of external configuration
files (something which can already be managed with findlib). I'm
shamelessly forwarding his idea and asking for feedback.

Where we have [open List] to open one specific module called [List], we
could introduce
* [use List] to open all the modules registered as providing namespace
[List]
* [import List] to locally rebind [List] to a module obtained by
including all the modules registered as providing namespace [List]

In each case, finding out which modules are registered as providing
namespace [List] is performed statically, by Camlp4 reading a set of
external configuration files.

What do you think?

Cheers,
 David
-- 
David Teller-Rajchenbach
 Security of Distributed Systems
  http://www.univ-orleans.fr/lifo/Members/David.Teller
 Angry researcher: French Universities need reforms, but the LRU act brings liquidations. 


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-11-22 19:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-11-20 21:29 About namespaces David Rajchenbach-Teller
2008-11-20 21:57 ` [Caml-list] " Christophe Raffalli
2008-11-21  9:24   ` David Rajchenbach-Teller
2008-11-22 19:30 ` Ashish Agarwal

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