From: David Rajchenbach-Teller <David.Teller@ens-lyon.org>
To: Caml <caml-list@yquem.inria.fr>
Subject: About namespaces
Date: Thu, 20 Nov 2008 22:29:16 +0100 [thread overview]
Message-ID: <1227216556.7676.31.camel@Blefuscu> (raw)
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.
next reply other threads:[~2008-11-20 21:29 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-11-20 21:29 David Rajchenbach-Teller [this message]
2008-11-20 21:57 ` [Caml-list] " Christophe Raffalli
2008-11-21 9:24 ` David Rajchenbach-Teller
2008-11-22 19:30 ` Ashish Agarwal
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=1227216556.7676.31.camel@Blefuscu \
--to=david.teller@ens-lyon.org \
--cc=caml-list@yquem.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