[erlang-questions] [Erlang]about "apply" function in the erlang.erl
Wed May 18 00:33:37 CEST 2011
On 17/05/2011, at 7:48 PM, 郎咸武 wrote:
> I see "apply" function invoke "apply“function in the "erlang.erl".
> I can`t understand it.
> Who can explain for me? Thanks.
> 57 apply(Fun, Args) ->
> 58 apply(Fun, Args).
> 60 apply(Mod, Name, Args) ->
> 61 apply(Mod, Name, Args).
It's a fairly common "bootstrapping" sort of thing.
- when the compiler sees apply/2 or apply/3 in an expression
it generates special in-line code
- there needs to be a "real" function definition so that it
can be called indirectly itself, discoverable in the
module exports, traced if calls arrive that way in the
More information about the erlang-questions