浏览 2442 次
精华帖 (0) :: 良好帖 (0) :: 新手帖 (0) :: 隐藏帖 (0)
|
|
---|---|
作者 | 正文 |
发表时间:2008-01-18
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 Fun2 = {lists,append} Fun2([1,2],[3,4]) => [1,2,3,4] For code replacement of funs to work, the tuple syntax {Module,FunctionName} must be used to represent the fun. 声明:ITeye文章版权属于作者,受法律保护。没有作者书面许可不得转载。
推荐链接
|
|
返回顶楼 | |
发表时间:2008-01-18
这个调用非常慢.
|
|
返回顶楼 | |
发表时间:2008-01-18
测试过了吗?还是从代码里面看出来的
|
|
返回顶楼 | |