[英]Difference between elixir:eval_forms and compile in elixir_compiler
在elixir_compiler.erl
(和其他一些地方)中,代码的编译以两种不同的方式完成。 以下代码在两者之间切换:
eval_forms(Forms, Args, E) ->
case (?key(E, module) == nil) andalso allows_fast_compilation(Forms) of
true ->
{Result, _Binding, EE} = elixir:eval_forms(Forms, [], E),
{Result, EE};
false ->
compile(Forms, Args, E)
end.
据我所知,一个通过构建编译模块并执行“编译函数”来编译代码,另一个使用erl_eval
模块,它是某种解释器。 我想知道的是为什么有两种不同的代码编译方式以及如何选择方式。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.