[erlang-questions] Why we need a -module() attribute?
Vlad Dumitrescu
vladdu55@REDACTED
Thu Feb 25 10:17:25 CET 2016
On Thu, Feb 25, 2016 at 9:10 AM, Bengt Kleberg <bengt.kleberg@REDACTED>
wrote:
> 2) Two binary packages/libs that I need must have different versions of
> some third lib.
This isn't a namespace problem.
It is a very interesting problem, though, and a difficult one. There are
solutions elsewhere that one could learn from (for example, Java's OSGi),
but like it was pointed out before, we have more than module names that are
global and that should be compartmentalized: process registry is the most
important one. Imagine if the third lib starts and registers a process -
there should be two of them, and each lib instance should only know about
its own process.
Going back to the original question, introducing namespaces brings up
similar issues: what should ?MODULE resolve to? We will probably need
?FULL_MODULE too, but when to use each? It's possible it will become
necessary to convert between the short and full name of a module - how? Are
macros still going to work or an introspection service is needed?
I think these are definitely worth investigating, answering and solving.
best regards,
Vlad
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20160225/03a960c8/attachment.htm>
More information about the erlang-questions
mailing list