[erlang-questions] Multiple modules

Bob Ippolito bob@REDACTED
Sun Oct 8 21:08:31 CEST 2006


On 10/8/06, Alex Arnon <alex.arnon@REDACTED> wrote:
>
>
> On 10/8/06, Daniel Goertzen <goertzen@REDACTED> wrote:
> > That starts to strongly resemble the way C++ namespaces work.
> >
> > Using the mnesia app as an example, the app source files are well
> > decomposed into their functional areas, for example: mnesia_subscr.erl,
> > mnesia_controller.erl, mnesia_checkpoint.erl, etc.  But the entire API
> > for mnesia is really exported through the module "mnesia", and
> > mnesia.erl contains lots of functions that just relay calls to other
> > modules.  Wouldn't it make more sense for each of the files (ex,
> > mnesia_subscr.erl) to be able to directly export bits and pieces into
> > the mnesia module/namespace?
> >
> > And this leads to the question of nested modules like C++ nested
> > namespaces.  I've found that nested namespaces in C++ have helped me
> > keep names short and natural and remove concern over collisions.
> > Consider this erlang example:
> >
> > Erlang makes me name stuff like this...
> >
> > myapp:foo_dostuff(...)
> > myapp:bar_dostuff(...)
> >
> >
> > When I'd really like to say it like this...
> >
> > myapp:foo:dostuff(...)
> > myapp:bar:dostuff(...)
> >
> >
> > Disclaimer:  I've written large c++ programs, but not any large elrang
> > programs yet.  Please correct me if I've missed out on some erlang
> feature.
> >
> > Cheers,
> > Dan.
>
>
>
> I can see where this would be useful.
> What about the X.X notation (e.g. in erlsoap)?

That actually works..

http://www.erlang.se/publications/packages.html

-bob



More information about the erlang-questions mailing list