[erlang-questions] Multiple modules

Alex Arnon alex.arnon@REDACTED
Sun Oct 8 18:32:11 CEST 2006


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)?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20061008/d227f183/attachment.htm>


More information about the erlang-questions mailing list