[erlang-questions] Why we need a -module() attribute?

Raoul Duke raould@REDACTED
Thu Feb 25 01:42:29 CET 2016

> The problem is that two different files may refer to a third module
> by different short names and may use the same short name to
> refer to different modules.  At least with Erlang we use exactly
> the same name everywhere.

That doesn't break any compilation.

It does make it harder for humans to grok, which is of course baaaaaad.

I don't get the example, really, I guess? Is it not the case that in
Java when you import foo.bar.baz, you now do not have to say baz.Thing
you only have to say Thing? Not a lot of extra typing? When there's 2
packages with Things then you have to go up one level of importing,

More information about the erlang-questions mailing list