[erlang-questions] [Erlang]about "apply" function in the erlang.erl

Bengt Kleberg bengt.kleberg@REDACTED
Tue May 17 12:44:58 CEST 2011


Greetings,

You need apply if you do not know the number of arguments.


bengt

On Tue, 2011-05-17 at 10:39 +0200, Andy W. Song wrote:
> Why do we need apply? Can't we just invoke the function directly?
> 
> 
> Thanks
> Andy
> 
> On Tue, May 17, 2011 at 3:51 PM, Bengt Kleberg
> <bengt.kleberg@REDACTED> wrote:
>         Greetings,
>         
>         apply is a built in function (BIF). It is implemented in C,
>         not Erlang.
>         
>         
>         bengt
>         
>         
>         On Tue, 2011-05-17 at 09:48 +0200, 郎咸武 wrote:
>         > hi,
>         >    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).
>         >  59
>         >  60 apply(Mod, Name, Args) ->
>         >  61     apply(Mod, Name, Args).
>         >
>         >
>         
>         
>         _______________________________________________
>         erlang-questions mailing list
>         erlang-questions@REDACTED
>         http://erlang.org/mailman/listinfo/erlang-questions
> 
> 




More information about the erlang-questions mailing list