caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Damien Doligez <Damien.Doligez@inria.fr>
To: caml-list@inria.fr
Subject: Re: [Caml-list] naming conflicts (was: camlimages vs. labltk)
Date: Tue, 1 Apr 2003 16:14:37 +0200	[thread overview]
Message-ID: <45804206-644C-11D7-9F5C-0003930FCE12@inria.fr> (raw)
In-Reply-To: <20030330103824.GA1884@iliana>

On Sunday, March 30, 2003, at 12:38 PM, Sven Luther wrote:

> But then, maybe i am just being stupid and completely misunderstand the
> problem or something such, please enlighten me if this is the case.

Judging from your and Chris Hecker's mail, I think it's my fault for
not explaining clearly what I have in mind.  Let me try again.

First of all, let me say that I am looking for a complete solution
to the problem, not just a quick fix that works most of the time.
 From this point of view, there is no difference between modules
and libraries: if there are naming conflicts between modules, there
will also be conflicts between libraries.

I'll give two examples of what I think the problem is.

First example:
I am building a program D, which uses libraries B and C.  B uses
another library, A.  C also uses another library, A.  But these are
not the same A, so I have a name conflict.  I don't want to change
the source code of B or C (because I am not the author, and updating
to a new version is much harder if I use modified libraries).

So I need to rename the A used by B, and I need to tell B to use
A under this new name.  This is why I need to rename imports as
well as exports.

Second example (somewhat artificial):
I am doing comparative benchmarks of two versions of library A.
I'd like to wrap up everything into one O'Caml program, so I need
to be able to link two different versions of A, and to call them
under two different names.

I don't need to rename imports for this one, but I think it
illustrates the problem with namespaces: are you going to demand
that every author of every library uses a different namespace for
each version of the library ?


Now that I think about it, I think both problems could be solved
by changing toplevel modules into functors (instead of modules with
free variables).  Then we only need a small linking language to tell
which export to use to satisfy each import.  With suitable defaults
(an import is satisfied by the export of the same name), this could
be made compatible with the current system.

-- Damien

-------------------
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:[~2003-04-01 14:50 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-03-25 19:33 [Caml-list] camlimages vs. labltk Shivkumar Chandrasekaran
2003-03-26  8:25 ` Alessandro Baretta
2003-03-26  8:33   ` Sven Luther
2003-03-26  9:00     ` Alessandro Baretta
2003-03-26 10:50       ` Sven Luther
2003-03-26 11:24         ` Alessandro Baretta
2003-03-26 11:38           ` Sven Luther
2003-03-26 19:08             ` Chris Hecker
2003-03-26 21:08               ` Alessandro Baretta
2003-03-27 17:23                 ` David Brown
2003-03-27 19:46                 ` Chris Hecker
2003-03-28  5:33                   ` Alessandro Baretta
2003-03-28  5:35                     ` David Brown
2003-03-28 14:10                   ` Damien Doligez
2003-03-28 15:00                     ` Sven Luther
2003-03-30 10:06                       ` Damien Doligez
2003-03-30 10:38                         ` Sven Luther
2003-04-01 14:14                           ` Damien Doligez [this message]
2003-04-01 15:05                             ` [Caml-list] naming conflicts (was: camlimages vs. labltk) Benjamin C. Pierce
2003-04-01 19:51                             ` Chris Hecker
2003-04-08 10:33                               ` Damien Doligez
2003-03-31  1:21                         ` [Caml-list] camlimages vs. labltk Chris Hecker
2003-03-30  9:26                     ` Alessandro Baretta
2003-03-26 18:49     ` Shivkumar Chandrasekaran
2003-03-26 10:48   ` Stefano Zacchiroli
2003-03-26 10:55     ` Sven Luther
2003-03-26 14:10       ` Stefano Zacchiroli

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=45804206-644C-11D7-9F5C-0003930FCE12@inria.fr \
    --to=damien.doligez@inria.fr \
    --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).