diff options
Diffstat (limited to 'system/doc')
-rw-r--r-- | system/doc/design_principles/Makefile | 2 | ||||
-rw-r--r-- | system/doc/design_principles/spec_proc.xml | 48 | ||||
-rw-r--r-- | system/doc/design_principles/sup_princ.xml | 10 | ||||
-rw-r--r-- | system/doc/efficiency_guide/Makefile | 2 | ||||
-rw-r--r-- | system/doc/embedded/Makefile | 2 | ||||
-rw-r--r-- | system/doc/getting_started/Makefile | 2 | ||||
-rw-r--r-- | system/doc/getting_started/seq_prog.xml | 22 | ||||
-rw-r--r-- | system/doc/oam/Makefile | 2 | ||||
-rw-r--r-- | system/doc/programming_examples/Makefile | 2 | ||||
-rw-r--r-- | system/doc/reference_manual/Makefile | 2 | ||||
-rw-r--r-- | system/doc/reference_manual/distributed.xml | 2 | ||||
-rw-r--r-- | system/doc/reference_manual/expressions.xml | 12 | ||||
-rw-r--r-- | system/doc/system_architecture_intro/Makefile | 2 | ||||
-rw-r--r-- | system/doc/system_principles/Makefile | 2 | ||||
-rw-r--r-- | system/doc/tutorial/Makefile | 2 |
15 files changed, 80 insertions, 34 deletions
diff --git a/system/doc/design_principles/Makefile b/system/doc/design_principles/Makefile index b3fe136644..ae951ba8d4 100644 --- a/system/doc/design_principles/Makefile +++ b/system/doc/design_principles/Makefile @@ -79,6 +79,8 @@ DVIPS_FLAGS += # ---------------------------------------------------- # Targets # ---------------------------------------------------- +_create_dirs := $(shell mkdir -p $(HTMLDIR)) + $(HTMLDIR)/%.gif: %.gif $(INSTALL_DATA) $< $@ diff --git a/system/doc/design_principles/spec_proc.xml b/system/doc/design_principles/spec_proc.xml index f0f62891b6..a1c862e004 100644 --- a/system/doc/design_principles/spec_proc.xml +++ b/system/doc/design_principles/spec_proc.xml @@ -411,30 +411,48 @@ loop(...) -> <p>To implement a user-defined behaviour, write code similar to code for a special process but calling functions in a callback module for handling specific tasks.</p> - <p>If it is desired that the compiler should warn for missing - callback functions, as it does for the OTP behaviours, implement - and export the function:</p> + <p>If it is desired that the compiler should warn for missing callback + functions, as it does for the OTP behaviours, add callback attributes in the + behaviour module to describe the expected callbacks:</p> + <code type="none"> +-callback Name1(Arg1_1, Arg1_2, ..., Arg1_N1) -> Res1. +-callback Name2(Arg2_1, Arg2_2, ..., Arg2_N2) -> Res2. +... +-callback NameM(ArgM_1, ArgM_2, ..., ArgM_NM) -> ResM.</code> + <p>where <c>NameX</c> are the names of the expected callbacks and + <c>ArgX_Y</c>, <c>ResX</c> are types as they are described in Specifications + for functions in <seealso marker="../reference_manual/typespec">Types and + Function Specifications</seealso>. The whole syntax of spec attributes is + supported by callback attributes.</p> + <p>Alternatively you may directly implement and export the function:</p> <code type="none"> behaviour_info(callbacks) -> [{Name1,Arity1},...,{NameN,ArityN}].</code> - <p>where each <c>{Name,Arity}</c> specifies the name and arity of - a callback function.</p> + <p>where each <c>{Name,Arity}</c> specifies the name and arity of a callback + function. This function is otherwise automatically generated by the compiler + using the callback attributes.</p> <p>When the compiler encounters the module attribute - <c>-behaviour(Behaviour).</c> in a module <c>Mod</c>, it will call - <c>Behaviour:behaviour_info(callbacks)</c> and compare the result - with the set of functions actually exported from <c>Mod</c>, and - issue a warning if any callback function is missing.</p> + <c>-behaviour(Behaviour).</c> in a module <c>Mod</c>, it will call + <c>Behaviour:behaviour_info(callbacks)</c> and compare the result with the + set of functions actually exported from <c>Mod</c>, and issue a warning if + any callback function is missing.</p> <p>Example:</p> <code type="none"> %% User-defined behaviour module -module(simple_server). -export([start_link/2,...]). --export([behaviour_info/1]). -behaviour_info(callbacks) -> - [{init,1}, - {handle_req,1}, - {terminate,0}]. +-callback init(State :: term()) -> 'ok'. +-callback handle_req(Req :: term(), State :: term()) -> {'ok', Reply :: term()}. +-callback terminate() -> 'ok'. + +%% Alternatively you may define: +%% +%% -export([behaviour_info/1]). +%% behaviour_info(callbacks) -> +%% [{init,1}, +%% {handle_req,2}, +%% {terminate,0}]. start_link(Name, Module) -> proc_lib:start_link(?MODULE, init, [self(), Name, Module]). @@ -452,7 +470,7 @@ init(Parent, Name, Module) -> -module(db). -behaviour(simple_server). --export([init/0, handle_req/1, terminate/0]). +-export([init/0, handle_req/2, terminate/0]). ...</code> </section> diff --git a/system/doc/design_principles/sup_princ.xml b/system/doc/design_principles/sup_princ.xml index df0777559a..a432f9458b 100644 --- a/system/doc/design_principles/sup_princ.xml +++ b/system/doc/design_principles/sup_princ.xml @@ -181,8 +181,16 @@ init(...) -> terminated using <c>exit(Child, kill)</c>.</item> <item>If the child process is another supervisor, it should be set to <c>infinity</c> to give the subtree enough time to - shutdown.</item> + shutdown. It is also allowed to set it to <c>infinity</c>, if the + child process is a worker.</item> </list> + <warning> + <p>Be careful by setting the <c>Shutdown</c> strategy to + <c>infinity</c> when the child process is a worker. Because, in this + situation, the termination of the supervision tree depends on the + child process, it must be implemented in a safe way and its cleanup + procedure must always return.</p> + </warning> </item> <item> <p><c>Type</c> specifies if the child process is a supervisor or diff --git a/system/doc/efficiency_guide/Makefile b/system/doc/efficiency_guide/Makefile index f51313de84..2629285b42 100644 --- a/system/doc/efficiency_guide/Makefile +++ b/system/doc/efficiency_guide/Makefile @@ -85,6 +85,8 @@ DVIPS_FLAGS += # ---------------------------------------------------- # Targets # ---------------------------------------------------- +_create_dirs := $(shell mkdir -p $(HTMLDIR)) + docs: html local_docs: PDFDIR=../../pdf diff --git a/system/doc/embedded/Makefile b/system/doc/embedded/Makefile index 5e68917fc2..70357efb1f 100644 --- a/system/doc/embedded/Makefile +++ b/system/doc/embedded/Makefile @@ -73,6 +73,8 @@ DVIPS_FLAGS += # ---------------------------------------------------- # Targets # ---------------------------------------------------- +_create_dirs := $(shell mkdir -p $(HTMLDIR)) + docs: html local_docs: PDFDIR=../../pdf diff --git a/system/doc/getting_started/Makefile b/system/doc/getting_started/Makefile index 5ca885d56e..5d85ca2adc 100644 --- a/system/doc/getting_started/Makefile +++ b/system/doc/getting_started/Makefile @@ -72,6 +72,8 @@ DVIPS_FLAGS += # ---------------------------------------------------- # Targets # ---------------------------------------------------- +_create_dirs := $(shell mkdir -p $(HTMLDIR)) + docs: html local_docs: PDFDIR=../../pdf diff --git a/system/doc/getting_started/seq_prog.xml b/system/doc/getting_started/seq_prog.xml index bc1758d855..96876ea513 100644 --- a/system/doc/getting_started/seq_prog.xml +++ b/system/doc/getting_started/seq_prog.xml @@ -4,7 +4,7 @@ <chapter> <header> <copyright> - <year>2003</year><year>2009</year> + <year>2003</year><year>2011</year> <holder>Ericsson AB. All Rights Reserved.</holder> </copyright> <legalnotice> @@ -41,9 +41,9 @@ <c>erl</c>, you will see something like this.</p> <pre> % <input>erl</input> -Erlang (BEAM) emulator version 5.2 [source] [hipe] +Erlang R15B (erts-5.9.1) [source] [smp:8:8] [rq:8] [async-threads:0] [hipe] [kernel-poll:false] -Eshell V5.2 (abort with ^G) +Eshell V5.9.1 (abort with ^G) 1></pre> <p>Now type in "2 + 5." as shown below.</p> <pre> @@ -245,7 +245,7 @@ convert(N, centimeter) -> inch in the convert function:</p> <pre> 12> <input>tut2:convert(3, miles).</input> -** exception error: no function clause matching tut2:convert(3,miles)</pre> +** exception error: no function clause matching tut2:convert(3,miles) (tut2.erl, line 4)</pre> <p>The two parts of the <c>convert</c> function are called its clauses. Here we see that "miles" is not part of either of the clauses. The Erlang system can't <em>match</em> either of @@ -255,11 +255,13 @@ convert(N, centimeter) -> command <c>v/1</c>:</p> <pre> 13> <input>v(12).</input> -{'EXIT',{function_clause,[{tut2,convert,[3,miles]}, - {erl_eval,do_apply,5}, - {shell,exprs,6}, - {shell,eval_exprs,6}, - {shell,eval_loop,3}]}}</pre> +{'EXIT',{function_clause,[{tut2,convert, + [3,miles], + [{file,"tut2.erl"},{line,4}]}, + {erl_eval,do_apply,5,[{file,"erl_eval.erl"},{line,482}]}, + {shell,exprs,7,[{file,"shell.erl"},{line,666}]}, + {shell,eval_exprs,7,[{file,"shell.erl"},{line,621}]}, + {shell,eval_loop,3,[{file,"shell.erl"},{line,606}]}]}}</pre> </section> @@ -943,7 +945,7 @@ A == 1 ; B == 7 a_equals_1_or_b_equals_7 66> <input>tut9:test_if(33, 33).</input> ** exception error: no true branch found when evaluating an if expression - in function tut9:test_if/2</pre> + in function tut9:test_if/2 (tut9.erl, line 5)</pre> <p>Notice that <c>tut9:test_if(33,33)</c> did not cause any condition to succeed so we got the run time error <c>if_clause</c>, here nicely formatted by the shell. See the chapter diff --git a/system/doc/oam/Makefile b/system/doc/oam/Makefile index e3288c9182..7732426ce6 100644 --- a/system/doc/oam/Makefile +++ b/system/doc/oam/Makefile @@ -69,6 +69,8 @@ DVIPS_FLAGS += # ---------------------------------------------------- # Targets # ---------------------------------------------------- +_create_dirs := $(shell mkdir -p $(HTMLDIR)) + $(HTMLDIR)/%.gif: %.gif $(INSTALL_DATA) $< $@ diff --git a/system/doc/programming_examples/Makefile b/system/doc/programming_examples/Makefile index 73512c9654..8aeead9f6a 100644 --- a/system/doc/programming_examples/Makefile +++ b/system/doc/programming_examples/Makefile @@ -70,6 +70,8 @@ DVIPS_FLAGS += # ---------------------------------------------------- # Targets # ---------------------------------------------------- +_create_dirs := $(shell mkdir -p $(HTMLDIR)) + docs: html local_docs: PDFDIR=../../pdf diff --git a/system/doc/reference_manual/Makefile b/system/doc/reference_manual/Makefile index 34e5b7f555..2e1f8e71cb 100644 --- a/system/doc/reference_manual/Makefile +++ b/system/doc/reference_manual/Makefile @@ -82,6 +82,8 @@ DVIPS_FLAGS += # ---------------------------------------------------- # Targets # ---------------------------------------------------- +_create_dirs := $(shell mkdir -p $(HTMLDIR)) + docs: html local_docs: PDFDIR=../../pdf diff --git a/system/doc/reference_manual/distributed.xml b/system/doc/reference_manual/distributed.xml index 9c8e88250c..d0eac78404 100644 --- a/system/doc/reference_manual/distributed.xml +++ b/system/doc/reference_manual/distributed.xml @@ -4,7 +4,7 @@ <chapter> <header> <copyright> - <year>2003</year><year>2009</year> + <year>2003</year><year>2011</year> <holder>Ericsson AB. All Rights Reserved.</holder> </copyright> <legalnotice> diff --git a/system/doc/reference_manual/expressions.xml b/system/doc/reference_manual/expressions.xml index 497d7eb464..644896cd7f 100644 --- a/system/doc/reference_manual/expressions.xml +++ b/system/doc/reference_manual/expressions.xml @@ -879,9 +879,8 @@ Ei = Value | and UTF-32, respectively.</p> <p>When constructing a segment of a <c>utf</c> type, <c>Value</c> - must be an integer in one of the ranges 0..16#D7FF, - 16#E000..16#FFFD, or 16#10000..16#10FFFF - (i.e. a valid Unicode code point). Construction + must be an integer in the range 0..16#D7FF or + 16#E000....16#10FFFF. Construction will fail with a <c>badarg</c> exception if <c>Value</c> is outside the allowed ranges. The size of the resulting binary segment depends on the type and/or <c>Value</c>. For <c>utf8</c>, @@ -896,14 +895,13 @@ Ei = Value | <c><![CDATA[<<$a/utf8,$b/utf8,$c/utf8>>]]></c>.</p> <p>A successful match of a segment of a <c>utf</c> type results - in an integer in one of the ranges 0..16#D7FF, 16#E000..16#FFFD, - or 16#10000..16#10FFFF - (i.e. a valid Unicode code point). The match will fail if returned value + in an integer in the range 0..16#D7FF or 16#E000..16#10FFFF. + The match will fail if returned value would fall outside those ranges.</p> <p>A segment of type <c>utf8</c> will match 1 to 4 bytes in the binary, if the binary at the match position contains a valid UTF-8 sequence. - (See RFC-2279 or the Unicode standard.)</p> + (See RFC-3629 or the Unicode standard.)</p> <p>A segment of type <c>utf16</c> may match 2 or 4 bytes in the binary. The match will fail if the binary at the match position does not contain diff --git a/system/doc/system_architecture_intro/Makefile b/system/doc/system_architecture_intro/Makefile index 0fff9bc4d5..8d677886b8 100644 --- a/system/doc/system_architecture_intro/Makefile +++ b/system/doc/system_architecture_intro/Makefile @@ -67,6 +67,8 @@ DVIPS_FLAGS += # ---------------------------------------------------- # Targets # ---------------------------------------------------- +_create_dirs := $(shell mkdir -p $(HTMLDIR)) + docs: html local_docs: PDFDIR=../../pdf diff --git a/system/doc/system_principles/Makefile b/system/doc/system_principles/Makefile index b0698fec9d..da109be211 100644 --- a/system/doc/system_principles/Makefile +++ b/system/doc/system_principles/Makefile @@ -66,6 +66,8 @@ DVIPS_FLAGS += # ---------------------------------------------------- # Targets # ---------------------------------------------------- +_create_dirs := $(shell mkdir -p $(HTMLDIR)) + docs: html local_docs: PDFDIR=../../pdf diff --git a/system/doc/tutorial/Makefile b/system/doc/tutorial/Makefile index efb380248e..d48082484c 100644 --- a/system/doc/tutorial/Makefile +++ b/system/doc/tutorial/Makefile @@ -88,6 +88,8 @@ DVIPS_FLAGS += # ---------------------------------------------------- # Targets # ---------------------------------------------------- +_create_dirs := $(shell mkdir -p $(HTMLDIR)) + $(HTMLDIR)/%.gif: %.gif $(INSTALL_DATA) $< $@ |