diff options
Diffstat (limited to 'system')
-rw-r--r-- | system/doc/design_principles/des_princ.xml | 2 | ||||
-rw-r--r-- | system/doc/efficiency_guide/binaryhandling.xml | 6 | ||||
-rw-r--r-- | system/doc/reference_manual/expressions.xml | 12 | ||||
-rw-r--r-- | system/doc/reference_manual/processes.xml | 4 | ||||
-rw-r--r-- | system/doc/reference_manual/typespec.xml | 11 | ||||
-rw-r--r-- | system/doc/tutorial/ei.c | 2 | ||||
-rw-r--r-- | system/doc/tutorial/example.xmlsrc | 6 |
7 files changed, 26 insertions, 17 deletions
diff --git a/system/doc/design_principles/des_princ.xml b/system/doc/design_principles/des_princ.xml index ba67a49585..0e087cf843 100644 --- a/system/doc/design_principles/des_princ.xml +++ b/system/doc/design_principles/des_princ.xml @@ -183,7 +183,7 @@ handle_cast({free, Ch}, Chs) -> <item>The server name, in this example the atom <c>ch2</c>, is hidden from the users of the client functions. This means that the name can be changed without affecting them.</item> - <item>The protcol (messages sent to and received from the server) + <item>The protocol (messages sent to and received from the server) is also hidden. This is good programming practice and allows one to change the protocol without changing the code using the interface functions.</item> diff --git a/system/doc/efficiency_guide/binaryhandling.xml b/system/doc/efficiency_guide/binaryhandling.xml index 51f8c4ebf0..0964b759d8 100644 --- a/system/doc/efficiency_guide/binaryhandling.xml +++ b/system/doc/efficiency_guide/binaryhandling.xml @@ -190,15 +190,15 @@ Bin4 = <<Bin1/binary,17>>, %% 5 !!! its size set to the size of the data stored in the binary, while the binary object has extra space allocated. The size of the binary object is either twice the - size of <c>Bin0</c> or 256, whichever is larger. In this case + size of <c>Bin1</c> or 256, whichever is larger. In this case it is 256.</item> <item>Line 3 is more interesting. <c>Bin1</c> <em>has</em> been used in an append operation, - and it has 255 bytes of unused storage at the end, so the 3 new + and it has 252 bytes of unused storage at the end, so the 3 new bytes are stored there.</item> - <item>Line 4. The same applies here. There are 252 bytes left, + <item>Line 4. The same applies here. There are 249 bytes left, so there is no problem storing another 3 bytes.</item> <item>Line 5. Here, something <em>interesting</em> happens. Notice diff --git a/system/doc/reference_manual/expressions.xml b/system/doc/reference_manual/expressions.xml index 668a51d6bc..893398b71b 100644 --- a/system/doc/reference_manual/expressions.xml +++ b/system/doc/reference_manual/expressions.xml @@ -568,10 +568,14 @@ Expr1 <input>op</input> Expr2</pre> <p>The arguments can be of different data types. The following order is defined:</p> <pre> -number < atom < reference < fun < port < pid < tuple < list < bit string</pre> +number < atom < reference < fun < port < pid < tuple < map < nil < list < bit string</pre> <p>Lists are compared element by element. Tuples are ordered by size, two tuples with the same size are compared element by element.</p> + <p>Maps are ordered by size, two maps with the same size are compared by keys in + ascending term order and then by values in key order. + In maps key order integers types are considered less than floats types. + </p> <p>When comparing an integer to a float, the term with the lesser precision is converted into the type of the other term, unless the operator is one of <c>=:=</c> or <c>=/=</c>. A float is more precise than @@ -591,7 +595,11 @@ true 2> <input>1=:=1.0.</input> false 3> <input>1 > a.</input> -false</pre> +false +4> <input>#{c => 3} > #{a => 1, b => 2}.</input> +false +4> <input>#{a => 1, b => 2} == #{a => 1.0, b => 2.0}.</input> +true</pre> </section> <section> diff --git a/system/doc/reference_manual/processes.xml b/system/doc/reference_manual/processes.xml index 6755bd8be6..f656d0318e 100644 --- a/system/doc/reference_manual/processes.xml +++ b/system/doc/reference_manual/processes.xml @@ -100,11 +100,9 @@ spawn(Module, Name, Args) -> pid() <item><c>exit(Reason)</c></item> <item><c>erlang:error(Reason)</c></item> <item><c>erlang:error(Reason, Args)</c></item> - <item><c>erlang:fault(Reason)</c></item> - <item><c>erlang:fault(Reason, Args)</c></item> </list> <p>The process then terminates with reason <c>Reason</c> for - <c>exit/1</c> or <c>{Reason,Stack} for the others</c>.</p> + <c>exit/1</c> or <c>{Reason,Stack}</c> for the others.</p> <p>A process can also be terminated if it receives an exit signal with another exit reason than <c>normal</c>, see <seealso marker="#errors">Error Handling</seealso>.</p> diff --git a/system/doc/reference_manual/typespec.xml b/system/doc/reference_manual/typespec.xml index 7891f3a6b9..22627058c1 100644 --- a/system/doc/reference_manual/typespec.xml +++ b/system/doc/reference_manual/typespec.xml @@ -197,6 +197,9 @@ <cell><c>char()</c></cell><cell><c>0..16#10ffff</c></cell> </row> <row> + <cell><c>nil()</c></cell><cell><c>[]</c></cell> + </row> + <row> <cell><c>number()</c></cell><cell><c>integer() | float()</c></cell> </row> <row> @@ -312,7 +315,7 @@ <p> As seen, the basic syntax of a type is an atom followed by closed parentheses. New types are declared using <c>-type</c> and <c>-opaque</c> - compiler attributes as in the following: + attributes as in the following: </p> <pre> -type my_struct_type() :: Type. @@ -435,8 +438,8 @@ <section> <title>Specifications for Functions</title> <p> - A specification (or contract) for a function is given using the new - compiler attribute <c>-spec</c>. The general format is as follows: + A specification (or contract) for a function is given using the + <c>-spec</c> attribute. The general format is as follows: </p> <pre> -spec Module:Function(ArgType1, ..., ArgTypeN) -> ReturnType.</pre> @@ -451,7 +454,7 @@ explicitly) import these functions. </p> <p> - Within a given module, the following shorthand suffice in most cases: + Within a given module, the following shorthand suffices in most cases: </p> <pre> -spec Function(ArgType1, ..., ArgTypeN) -> ReturnType.</pre> diff --git a/system/doc/tutorial/ei.c b/system/doc/tutorial/ei.c index b234a00768..c33e3fb78e 100644 --- a/system/doc/tutorial/ei.c +++ b/system/doc/tutorial/ei.c @@ -21,7 +21,7 @@ int main() { if (strncmp(ERL_ATOM_PTR(fnp), "foo", 3) == 0) { res = foo(ERL_INT_VALUE(argp)); - } else if (strncmp(ERL_ATOM_PTR(fnp), "bar", 17) == 0) { + } else if (strncmp(ERL_ATOM_PTR(fnp), "bar", 3) == 0) { res = bar(ERL_INT_VALUE(argp)); } diff --git a/system/doc/tutorial/example.xmlsrc b/system/doc/tutorial/example.xmlsrc index d49c7fe88c..91f09ec522 100644 --- a/system/doc/tutorial/example.xmlsrc +++ b/system/doc/tutorial/example.xmlsrc @@ -11,7 +11,7 @@ Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at - + http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software @@ -19,7 +19,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. - + </legalnotice> <title>Problem Example</title> @@ -39,7 +39,7 @@ <codeinclude file="complex.c" tag="" type="none"></codeinclude> <p>The functions are deliberately kept as simple as possible, for readability reasons.</p> - <p>From an Erlang perspektive, it is preferable to be able to call + <p>From an Erlang perspective, it is preferable to be able to call <c>foo</c> and <c>bar</c> without having to bother about that they are C functions:</p> <pre> |