Skip to content

Commit

Permalink
Reference manual: Improve the documentation for external funs
Browse files Browse the repository at this point in the history
  • Loading branch information
bjorng committed Nov 2, 2011
1 parent b9e610c commit 33c08d8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
4 changes: 2 additions & 2 deletions system/doc/reference_manual/code_loading.xml
Expand Up @@ -112,8 +112,8 @@ loop() ->
<c>code_switch</c> to it. The process then will make a fully
qualified call to <c>m:loop()</c> and change to current code.
Note that <c>m:loop/0</c> must be exported.</p>
<p>For code replacement of funs to work, the tuple syntax
<c>{Module,FunctionName}</c> must be used to represent the fun.</p>
<p>For code replacement of funs to work, the syntax
<c>fun Module:FunctionName/Arity</c> should be used.</p>
</section>

<section>
Expand Down
7 changes: 5 additions & 2 deletions system/doc/reference_manual/expressions.xml
Expand Up @@ -995,13 +995,16 @@ fun (Arg1,...,ArgN) -> Name(Arg1,...,ArgN) end</pre>
<p>In <c>Module:Name/Arity</c>, <c>Module</c> and <c>Name</c> are atoms
and <c>Arity</c> is an integer.
A fun defined in this way will refer to the function <c>Name</c>
with arity <c>Arity</c> in the <em>latest</em> version of module <c>Module</c>.
with arity <c>Arity</c> in the <em>latest</em> version of module
<c>Module</c>. A fun defined in this way will not be dependent on
the code for module in which it is defined.
</p>
<p>When applied to a number N of arguments, a tuple
<c>{Module,FunctionName}</c> is interpreted as a fun, referring
to the function <c>FunctionName</c> with arity N in the module
<c>Module</c>. The function must be exported.
<em>This usage is deprecated.</em>
<em>This usage is deprecated.</em> Use <c>fun Module:Name/Arity</c>
instead.
See <seealso marker="#calls">Function Calls</seealso> for an example.</p>
<p>More examples can be found in <em>Programming Examples</em>.</p>
</section>
Expand Down

0 comments on commit 33c08d8

Please sign in to comment.