What decides the name of a module?

Roger Price rprice@REDACTED
Mon Jun 30 22:35:53 CEST 2003


What decides the name of a module?

I wrote a program in file hello_all.erl which contains the declaration
-module(hello) .

When the file hello_all.erl is compiled, I get the executable
hello_all.beam and compile:file/2 replies {ok,hello}.

I am assuming that my module name is 'hello', but the command
code:which(hello) returns 'non_existing'.  The command
code:which(hello_all) gives me "./ebin/hello_all.beam".

Is the module name specified by the declaration -module(.) or implied by
the source file name? - or are there two different notions of "module"
that I am confusing?

Any advice would be much appreciated.

Best Regards,
Roger





More information about the erlang-questions mailing list