R12B0的文档里面写着:
6.6 Function Calls
ExprF(Expr1,...,ExprN)
ExprM:ExprF(Expr1,...,ExprN)
ExprM should evaluate to a module name and ExprF to a function name or a fun.
When including the module name, the function is said to be called by using the fully qualified function name. This is often referred to as a remote or external function call. Example:
lists:keysearch(Name, 1, List)
The module name can be omitted, if ExprF evaluates to the name of a local function, an imported function, or an auto-imported BIF. Then the function is said to be called by using the implicitly qualified function name. Examples:
handle(Msg, State)
spawn(m, init, [])
To avoid possible ambiguities, the fully qualified function name must be used when calling a function with the same name as a BIF, and the compiler does not allow defining a function with the same name as an imported function.
Note that when calling a local function, there is a difference between using the implicitly or fully qualified function name, as the latter always refer to the latest version of the module. See Compilation and Code Loading.
If ExprF evaluates to a fun, only the format ExprF(Expr1,...,ExprN) is correct. Example:
Fun1 = fun(X) -> X+1 end
Fun1(3)
=> 4
[color=red]
Fun2 = {lists,append}
Fun2([1,2],[3,4])
=> [1,2,3,4][/color]
[color=red]For code replacement of funs to work, the tuple syntax {Module,FunctionName} must be used to represent the fun.[/color]
6.6 Function Calls
ExprF(Expr1,...,ExprN)
ExprM:ExprF(Expr1,...,ExprN)
ExprM should evaluate to a module name and ExprF to a function name or a fun.
When including the module name, the function is said to be called by using the fully qualified function name. This is often referred to as a remote or external function call. Example:
lists:keysearch(Name, 1, List)
The module name can be omitted, if ExprF evaluates to the name of a local function, an imported function, or an auto-imported BIF. Then the function is said to be called by using the implicitly qualified function name. Examples:
handle(Msg, State)
spawn(m, init, [])
To avoid possible ambiguities, the fully qualified function name must be used when calling a function with the same name as a BIF, and the compiler does not allow defining a function with the same name as an imported function.
Note that when calling a local function, there is a difference between using the implicitly or fully qualified function name, as the latter always refer to the latest version of the module. See Compilation and Code Loading.
If ExprF evaluates to a fun, only the format ExprF(Expr1,...,ExprN) is correct. Example:
Fun1 = fun(X) -> X+1 end
Fun1(3)
=> 4
[color=red]
Fun2 = {lists,append}
Fun2([1,2],[3,4])
=> [1,2,3,4][/color]
[color=red]For code replacement of funs to work, the tuple syntax {Module,FunctionName} must be used to represent the fun.[/color]