caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Sven Luther <luther@dpt-info.u-strasbg.fr>
To: Damien Doligez <Damien.Doligez@inria.fr>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] camlimages vs. labltk
Date: Sun, 30 Mar 2003 12:38:24 +0200	[thread overview]
Message-ID: <20030330103824.GA1884@iliana> (raw)
In-Reply-To: <45905683-6297-11D7-B6B4-0003930FCE12@inria.fr>

On Sun, Mar 30, 2003 at 12:06:27PM +0200, Damien Doligez wrote:
> On Friday, March 28, 2003, at 04:00 PM, Sven Luther wrote:
> 
> >Does this not sound as a ugly hack ?
> 
> Not to me...

Ok, ...

> >Would it not be easier to have something akin to -pack, but without its
> >technical problems, and have each library pack its module into a
> >namespace propper to this library ?
> 
> How do you make sure that two different libraries never use the same
> namespace ?  And if I need to use two versions of the same library
> in my program, how do you make sure that two versions of the same
> library never use the same namespace ?

Because you use something similar to the -pack option, each module
inside a library would be qualified by the library name, so the only
reason there could be a namespace conflict would be if two library used
the same name (like if ocamltk and labltk both used Tk. or both mlgtk
and lablgtk used Gtk.).

If there is such a conflict, either the people doing the conflicting
libraries discuss among themselves to solve the problem, either by one
of them renaming their lib or both of them merging , or some higher
authority (the ocaml team, a ocaml standardization comitee, a consensus
reached on the ocaml mailing list) takes some decision on on which way
the name should go. But still, i believe the name clash will pretty much
be extremely rare, since they would occur only with the names of the
library, not with the modules inside the libraries.

Now, i understand that the -pack option is not technically ready for
such a solution, if you consider that you have to link all modules of
the library inside one huge .cmo, which has to be included whole anytime
you use it. But i think that the above is the right solution to the
naming problem, and if i remember well, some members of the ocaml team
also seemed to be of that opinion last time this was discussed.

> >If all library did this by default, at library build time, then there
> >would be no need to rename the imports, since those imports would
> >already have the modified (that is Library.Module) names ?
> 
> You can't avoid renaming of imports unless you have a centralized
> allocation of namespaces, and _that_ sounds like an ugly hack to me.

I still don't understand what would have been renamed. Let's say a
module A inside a library foo imports a module B from library bar.

right now, we have the following :

  A imports B

this causes problem if you want to link with another library
which also has a module named B, or if you wish to name your own module
B.

now, if all modules of the library would be submodules of the library,
then we would have :

  Foo.A imports Bar.B

And now, another library zzz could have a module called B, which would
be accesed as Zzz.B, and there would be no need to rename the imports.
And even the personal module could either be plain B, or Personal.B or
something.

Sure, this displace the problam to library names instead of module
names, but still, there are much less libraries around than there are
modules.

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

Friendly,

Sven Luther

-------------------
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-03-30 10:38 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-03-25 19:33 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 [this message]
2003-04-01 14:14                           ` [Caml-list] naming conflicts (was: camlimages vs. labltk) Damien Doligez
2003-04-01 15:05                             ` 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=20030330103824.GA1884@iliana \
    --to=luther@dpt-info.u-strasbg.fr \
    --cc=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).