Packages in Erlang: new documentation

Lon Willett <>
Wed Sep 3 18:58:17 CEST 2003


On ons, 2003-09-03 at 14:34, Richard Carlsson  wrote:
> Since the R9B release of Erlang, "packages" (hierarchical module
> namespaces) have been available for testing by the Erlang community.
> 
> It seems that the information about this, and how it works, has not
> reached enough people. ...

I have started to use it.  One major problem for me is that I haven't
been able to get the code coverage tools to work with it ("cover"
module).  Am I doing something wrong, or is this just a bug?

One nice extension might be an "-import_as" directive, at least if it
becomes common practice to use very long package names in order to avoid
conflicts.  e.g. One might write a package "some.very.long.package.name"
with a module "format" that exports functions "foo" and "bar".  While
this works very prettily while writing the module (use "format:foo" to
format a "foo"), users of the module may neither wish to have to use the
full "some.very.long.package.name" nor to import a module named just
"format".  So it would be nice if they could use:

-import_as(some.very.long.package.name.format,shortname_format).

Then they could use "shortname_format:foo" and "shortname_format:bar" in
their code.

Just a thought (for whomever is hacking the package system)...

/Lon



More information about the erlang-questions mailing list