From 33c08d87a9395ae088eebcad9fb62193d26b6846 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Wed, 26 May 2010 15:50:59 +0200 Subject: Reference manual: Improve the documentation for external funs --- system/doc/reference_manual/code_loading.xml | 4 ++-- system/doc/reference_manual/expressions.xml | 7 +++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/system/doc/reference_manual/code_loading.xml b/system/doc/reference_manual/code_loading.xml index f56e1ff408..3ea72a4057 100644 --- a/system/doc/reference_manual/code_loading.xml +++ b/system/doc/reference_manual/code_loading.xml @@ -112,8 +112,8 @@ loop() -> code_switch to it. The process then will make a fully qualified call to m:loop() and change to current code. Note that m:loop/0 must be exported.

-

For code replacement of funs to work, the tuple syntax - {Module,FunctionName} must be used to represent the fun.

+

For code replacement of funs to work, the syntax + fun Module:FunctionName/Arity should be used.

diff --git a/system/doc/reference_manual/expressions.xml b/system/doc/reference_manual/expressions.xml index c24b1110a4..4d211ae1d3 100644 --- a/system/doc/reference_manual/expressions.xml +++ b/system/doc/reference_manual/expressions.xml @@ -995,13 +995,16 @@ fun (Arg1,...,ArgN) -> Name(Arg1,...,ArgN) end

In Module:Name/Arity, Module and Name are atoms and Arity is an integer. A fun defined in this way will refer to the function Name - with arity Arity in the latest version of module Module. + with arity Arity in the latest version of module + Module. A fun defined in this way will not be dependent on + the code for module in which it is defined.

When applied to a number N of arguments, a tuple {Module,FunctionName} is interpreted as a fun, referring to the function FunctionName with arity N in the module Module. The function must be exported. - This usage is deprecated. + This usage is deprecated. Use fun Module:Name/Arity + instead. See Function Calls for an example.

More examples can be found in Programming Examples.

-- cgit v1.2.3