【发布时间】:2020-07-21 22:47:22
【问题描述】:
我正在学习 erlnag,对“.beam”文件的创建有一点疑问。 例如我有 helloworld.erl 和 top.erl 文件,并且 helloworld.erl 被导入到 top.erl 中。
top.erl:
-module(top).
-import(helloworld, [start/0]).
-export([main/0]).
main() ->
io:fwrite("hello\n"),
start().
helloworld.erl
-module(helloworld).
-export([start/0]).
start() ->
io:fwrite("hello world\n").
然后使用“erlc top.erl”编译top.erl。然后,它只创建top.beam文件而不创建helloworld.beam文件。
但是当我们看到python和java的情况下,在编译导入文件时也会为导入的文件生成目标文件。
这是“erlang”的行为(即不为导入的文件创建 .beam 文件)还是我理解错了?
(或)
请说明在运行导入模块时获取“.beam”文件的过程。
谢谢..
【问题讨论】:
标签: erlang