diff options
Diffstat (limited to 'system')
-rw-r--r-- | system/doc/definitions/term.defs | 5 | ||||
-rw-r--r-- | system/doc/reference_manual/expressions.xml | 23 |
2 files changed, 14 insertions, 14 deletions
diff --git a/system/doc/definitions/term.defs b/system/doc/definitions/term.defs index f3d6f865d2..6091a46a20 100644 --- a/system/doc/definitions/term.defs +++ b/system/doc/definitions/term.defs @@ -1,8 +1,6 @@ [{"agent","agent","An entity that terminates a management protocol in the Network Element.","mbj"}, {"API","API","Application Programming Interface. The interface towards an application. Usually this is a set of functions available, but can also be a set of messages sent to or from an application.","mbj"}, {"application","application","A collection of resources which is required to offer a specific service.","mbj"}, -{"appmon","Application Monitor","A graphical node and application process tree viewer. See also appmon.","mbj"}, -{"Appmon","Appmon","Application name for the Application Monitor within Erlang/OTP. A graphical node and process viewer.","mbj"}, {"app callback","application callback module","A module which is called when the application is started, and when it has stopped. Every application has one application callback module.","mbj"}, {"AC","application controller","A process which coordinates all operations on applications.","mbj"}, {"app master","application master","The application master is a process that monitors the application. It is provided by the Erlang run-time system. Every application has an application master process.","mbj"}, @@ -137,7 +135,6 @@ the module Erlang in the application kernel","kenneth"}, {"pattern matching","pattern matching","A basic mechanism in Erlang for assigning values to variables and for controlling the flow of a program.","kenneth"}, {"permanent child","permanent child","A supervised process which always is restarted when it dies.","mbj"}, {"Pid","Pid","Process Identifier. A data type in Erlang for storing process references. The process identity of the process displayed in the line.","kenneth"}, -{"Pman","Pman","Module and application name for the Process Trace Tool.","olin"}, {"point","point","A unit used to indicate the size of a typeface. Equal to 1/72 inches.","jocke"}, {"pointer","pointer","A pointer tells where data is stored. Memory pointers are not used in Erlang.","kent"}, {"port","port","A data type in Erlang. Ports provide the basic mechanism for communication with the external world.","peterl"}, @@ -196,10 +193,8 @@ the module Erlang in the application kernel","kenneth"}, {"sup_bridge","supervisor bridge"," A behaviour used to connect a process, or subsystem, to a supervisor tree.","mbj"}, {"SASLlong","System Architecture Support Libraries (SASL)","An Erlang/OTP application which contains services for error logging, release handling and report browsing.","mbj"}, {".config","system configuration file","A file which specifies configuration parameters for the applications in the system.","mbj"}, {"table lock","table lock","Table locks are locks which are set on whole tables. They may either be read locks or write locks.","hakan"}, -{"Table Visualizer","Table Visualizer","A tool which enables the user to examine ETS and Mnesia tables.","olin"}, {"temporary child","temporary child","A supervised process which is never restarted when it dies.","mbj"}, {"term","term","The super type of all Erlang types.","kenneth"}, -{"Toolbar","Toolbar","A tool that provides an simplistic interface to the other various Erlang/OTP tools","olin"}, {"tools","tools","An application within Erlang/OTP which contains the tools which are not applications themselves.","olin"}, {"transaction","transaction","Transactions groups a set of database accesses into an atomic unit. All transactions has the ACID (atomicity, concistency, isolation and durability) properties.","hakan"}, {"transient child","transient child","A supervised process which is restarted if it dies non-normally.","mbj"}, diff --git a/system/doc/reference_manual/expressions.xml b/system/doc/reference_manual/expressions.xml index 0dc6bfe576..e9de3e006e 100644 --- a/system/doc/reference_manual/expressions.xml +++ b/system/doc/reference_manual/expressions.xml @@ -954,19 +954,20 @@ Ei = Value | <title>Fun Expressions</title> <pre> fun - (Pattern11,...,Pattern1N) [when GuardSeq1] -> - Body1; + [Name](Pattern11,...,Pattern1N) [when GuardSeq1] -> + Body1; ...; - (PatternK1,...,PatternKN) [when GuardSeqK] -> - BodyK + [Name](PatternK1,...,PatternKN) [when GuardSeqK] -> + BodyK end</pre> <p>A fun expression begins with the keyword <c>fun</c> and ends with the keyword <c>end</c>. Between them should be a function declaration, similar to a - <seealso marker="functions#syntax">regular function declaration</seealso>, except that no function name is - specified.</p> - <p>Variables in a fun head shadow variables in the - function clause surrounding the fun expression, and + <seealso marker="functions#syntax">regular function declaration</seealso>, + except that the function name is optional and should be a variable if + any.</p> + <p>Variables in a fun head shadow the function name and both shadow + variables in the function clause surrounding the fun expression, and variables bound in a fun body are local to the fun body.</p> <p>The return value of the expression is the resulting fun.</p> <p>Examples:</p> @@ -978,7 +979,11 @@ end</pre> 3> <input>Fun2 = fun (X) when X>=5 -> gt; (X) -> lt end.</input> #Fun<erl_eval.6.39074546> 4> <input>Fun2(7).</input> -gt</pre> +gt +5> <input>Fun3 = fun Fact(1) -> 1; Fact(X) when X > 1 -> X * Fact(X - 1) end.</input> +#Fun<erl_eval.6.39074546> +6> <input>Fun3(4).</input> +24</pre> <p>The following fun expressions are also allowed:</p> <pre> fun Name/Arity |