From 39dc426b3ee91cb1d2628f217c83147354663cc0 Mon Sep 17 00:00:00 2001 From: Hans Bolinder Date: Wed, 16 Dec 2015 14:31:41 +0100 Subject: doc: Update a refman example --- system/doc/reference_manual/expressions.xml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/system/doc/reference_manual/expressions.xml b/system/doc/reference_manual/expressions.xml index 893398b71b..e98fcbcbb9 100644 --- a/system/doc/reference_manual/expressions.xml +++ b/system/doc/reference_manual/expressions.xml @@ -245,13 +245,13 @@ lists:keysearch(Name, 1, List) handle(Msg, State) spawn(m, init, [])

Examples where ExprF is a fun:

- -Fun1 = fun(X) -> X+1 end -Fun1(3) -=> 4 - -fun lists:append/2([1,2], [3,4]) -=> [1,2,3,4] +
+1> Fun1 = fun(X) -> X+1 end,
+Fun1(3).
+4
+2> fun lists:append/2([1,2], [3,4]).
+[1,2,3,4]
+3> 

Notice that when calling a local function, there is a difference between using the implicitly or fully qualified function name. @@ -1004,7 +1004,7 @@ M4 = M3#{a := 2, b := 3}. % 'a' and 'b' was added in `M1` and `M2`.

A badmatch exception.

-

This is if it is used in the context of the matching operator +

This is if it is used in the context of the match operator as in the example.

Or resulting in the next clause being tested in function heads and @@ -1085,7 +1085,7 @@ Ei = Value |

Used in a bit string construction, Value is an expression that is to evaluate to an integer, float, or bit string. If the expression is not a single literal or variable, it - is to be enclosed in parenthesis.

+ is to be enclosed in parentheses.

Used in a bit string matching, Value must be a variable, or an integer, float, or string.

@@ -1319,7 +1319,7 @@ catch Expr {'EXIT',{badarith,[...]}}

Notice that catch has low precedence and catch subexpressions often needs to be enclosed in a block - expression or in parenthesis:

+ expression or in parentheses:

 3> A = catch 1+2.
 ** 1: syntax error before: 'catch' **
-- 
cgit v1.2.3