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

Kenneth Lakin kennethlakin@REDACTED
Tue Feb 23 20:53:54 CET 2016


On 02/23/2016 10:12 AM, Judson Lester wrote:
> I'd really like to be able to put that in src/myapp/part/subpart.erl -
> maybe this is a misapprehension turned superstition, but I was under the
> impression that I'd need to have a whole separate build step to copy the
> latter into the former before handing it to erlc. Is that not the case?

It doesn't seem to be the case. This works just fine for me with Erlang 18:

$ ls
$ mkdir -p dir/with/parents
$ echo "-module (test).
> -compile (export_all).
>
> run() -> ok." > dir/with/parents/test.erl
$ erlc dir/with/parents/test.erl
$ ls
dir  test.beam
$



-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20160223/f444afb1/attachment.bin>


More information about the erlang-questions mailing list