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

Éric Pailleau eric.pailleau@REDACTED
Wed Feb 17 13:46:34 CET 2016

I suppose it is necessary when building a module from an abstract code not coming from a file on disk.

Le 17 févr. 2016 10:45 AM, Konstantin Vsochanov <kost@REDACTED> a écrit :
> Hi!
> I’m working with Erlang for two years now and enjoy every day of using
> it. However, there are some strange  features I’m wondering about. One
> of them -module() attribute.
> The module name is strictly defined by the name of the .erl file. You
> can’t change module name with -module() attribute. But the the -module()
> attribute is mandatory. Why? Why we need -module() attribute at all?
> Maybe we can make -module() optional in next Erlang release? So we don’t
> need to repeat file name in first string of every .erl file. Or maybe I
> miss something important?
> Feedback is appreciated!
> - Konstantin Voschanov
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions

More information about the erlang-questions mailing list