From 0e38f3d443842728be24e4cbd1608dcaa3a41bdb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= This module is deprecated and will be removed in Erlang/OTP 18. This (experimental) module implements process groups. A process
- group is a group of processes that can be accessed by a common
- name. For example, a group named When messages are sent to the named group, all members of
- the group receive the message. The messages are serialized. If
- the process This module is not complete. The module is inspired by the ISIS
- system and the causal order protocol of the ISIS system should
- also be implemented. At the moment, all messages are serialized
- by sending them through a group master process. Creates an empty group named Creates an empty group named Joins the pid Sends the tuple Failure: Sends the tuple Failure: Returns a list of all members of the process group
- In this example, we chose to copy the binary content before
- inserting it in the
This function orders the process to terminate with the
+ given
Orders the process to exit with the given
The function returns
If the call times out, a
If the process does not exist, a
The implementation of this function is based on the
+
gen_fsm module Callback module
-------------- ---------------
+gen_fsm:start
gen_fsm:start_link -----> Module:init/1
+gen_fsm:stop -----> Module:terminate/3
+
gen_fsm:send_event -----> Module:StateName/2
gen_fsm:send_all_state_event -----> Module:handle_event/3
@@ -186,6 +189,39 @@ gen_fsm:sync_send_all_state_event -----> Module:handle_sync_event/4
for a description of arguments and return values.
+
+ stop(FsmRef) -> ok
+ stop(FsmRef, Reason, Timeout) -> ok
+ Synchronously stop a generic FSM.
+
+ FsmRef = Name | {Name,Node} | {global,GlobalName}
+ | {via,Module,ViaName} | pid()
+ Node = atom()
+ GlobalName = ViaName = term()
+ Reason = term()
+ Timeout = int()>0 | infinity
+
+
+ Orders a generic FSM to exit with the given Reason
+ and waits for it to terminate. The gen_fsm will call
+ Module:terminate/3
+ before exiting.
+ The function returns ok if the generic FSM terminates
+ with the expected reason. Any other reason than normal ,
+ shutdown , or {shutdown,Term} will cause an
+ error report to be issued using
+ error_logger:format/2 .
+ The default Reason is normal .
+ Timeout is an integer greater than zero which
+ specifies how many milliseconds to wait for the generic FSM
+ to terminate, or the atom infinity to wait
+ indefinitely. The default value is infinity . If the
+ generic FSM has not terminated within the specified time, a
+ timeout exception is raised.
+ If the process does not exist, a noproc exception
+ is raised.
+
+
send_event(FsmRef, Event) -> ok
Send an event asynchronously to a generic FSM.
diff --git a/lib/stdlib/doc/src/gen_server.xml b/lib/stdlib/doc/src/gen_server.xml
index 4c83fde237..4bef50245d 100644
--- a/lib/stdlib/doc/src/gen_server.xml
+++ b/lib/stdlib/doc/src/gen_server.xml
@@ -4,7 +4,7 @@
- 1996 2013
+ 1996 2014
Ericsson AB. All Rights Reserved.
@@ -43,8 +43,11 @@
gen_server module Callback module
----------------- ---------------
+gen_server:start
gen_server:start_link -----> Module:init/1
+gen_server:stop -----> Module:terminate/2
+
gen_server:call
gen_server:multi_call -----> Module:handle_call/3
@@ -183,6 +186,40 @@ gen_server:abcast -----> Module:handle_cast/2
for a description of arguments and return values.
+
+ stop(ServerRef) -> ok
+ stop(ServerRef, Reason, Timeout) -> ok
+ Synchronously stop a generic server.
+
+ ServerRef = Name | {Name,Node} | {global,GlobalName}
+ | {via,Module,ViaName} | pid()
+ Node = atom()
+ GlobalName = ViaName = term()
+ Reason = term()
+ Timeout = int()>0 | infinity
+
+
+ Orders a generic server to exit with the
+ given Reason and waits for it to terminate. The
+ gen_server will call
+ Module:terminate/2
+ before exiting.
+ The function returns ok if the server terminates
+ with the expected reason. Any other reason than normal ,
+ shutdown , or {shutdown,Term} will cause an
+ error report to be issued using
+ error_logger:format/2 .
+ The default Reason is normal .
+ Timeout is an integer greater than zero which
+ specifies how many milliseconds to wait for the server to
+ terminate, or the atom infinity to wait
+ indefinitely. The default value is infinity . If the
+ server has not terminated within the specified time, a
+ timeout exception is raised.
+ If the process does not exist, a noproc exception
+ is raised.
+
+
call(ServerRef, Request) -> Reply
call(ServerRef, Request, Timeout) -> Reply
--
cgit v1.2.3
From f979493bfa777e61d4da1460982370c0cecc1ef3 Mon Sep 17 00:00:00 2001
From: Siri Hansen
Date: Tue, 6 May 2014 11:50:45 +0200
Subject: Update gen_event:stop to be synchronous
This function now uses proc_lib:stop, which guarantees that the
process is terminated before the function return.
---
lib/stdlib/doc/src/gen_event.xml | 35 +++++++++++++++++++++++++++--------
1 file changed, 27 insertions(+), 8 deletions(-)
(limited to 'lib/stdlib/doc/src')
diff --git a/lib/stdlib/doc/src/gen_event.xml b/lib/stdlib/doc/src/gen_event.xml
index b9dfff833e..5c96d6e576 100644
--- a/lib/stdlib/doc/src/gen_event.xml
+++ b/lib/stdlib/doc/src/gen_event.xml
@@ -4,7 +4,7 @@
- 1996 2013
+ 1996 2014
Ericsson AB. All Rights Reserved.
@@ -44,6 +44,7 @@
gen_event module Callback module
---------------- ---------------
+gen_event:start
gen_event:start_link -----> -
gen_event:add_handler
@@ -177,7 +178,7 @@ gen_event:stop -----> Module:terminate/2
add_handler(EventMgrRef, Handler, Args) -> Result
Add an event handler to a generic event manager.
- EventMgr = Name | {Name,Node} | {global,GlobalName}
+ EventMgrRef = Name | {Name,Node} | {global,GlobalName}
| {via,Module,ViaName} | pid()
Name = Node = atom()
GlobalName = ViaName = term()
@@ -223,7 +224,7 @@ gen_event:stop -----> Module:terminate/2
add_sup_handler(EventMgrRef, Handler, Args) -> Result
Add a supervised event handler to a generic event manager.
- EventMgr = Name | {Name,Node} | {global,GlobalName}
+ EventMgrRef = Name | {Name,Node} | {global,GlobalName}
| {via,Module,ViaName} | pid()
Name = Node = atom()
GlobalName = ViaName = term()
@@ -456,19 +457,37 @@ gen_event:stop -----> Module:terminate/2
stop(EventMgrRef) -> ok
+ stop(EventMgrRef, Reason, Timeout) -> ok
Terminate a generic event manager.
EventMgrRef = Name | {Name,Node} | {global,GlobalName}
| {via,Module,ViaName} | pid()
Name = Node = atom()
GlobalName = ViaName = term()
+ Reason = term()
+ Timeout = int()>0 | infinity
- Terminates the event manager EventMgrRef . Before
- terminating, the event manager will call
- Module:terminate(stop,...) for each installed event
- handler.
- See add_handler/3 for a description of the argument.
+ Orders the event manager EventMgrRef to exit with
+ the given Reason and waits for it to
+ terminate. Before terminating, the gen_event will call
+ Module:terminate(stop,...)
+ for each installed event handler.
+ The function returns ok if the event manager terminates
+ with the expected reason. Any other reason than normal ,
+ shutdown , or {shutdown,Term} will cause an
+ error report to be issued using
+ error_logger:format/2 .
+ The default Reason is normal .
+ Timeout is an integer greater than zero which
+ specifies how many milliseconds to wait for the event manager to
+ terminate, or the atom infinity to wait
+ indefinitely. The default value is infinity . If the
+ event manager has not terminated within the specified time, a
+ timeout exception is raised.
+ If the process does not exist, a noproc exception
+ is raised.
+ See add_handler/3 for a description of EventMgrRef .
--
cgit v1.2.3
From 90b779ed59c734b31d26f0b18571a531923ce9f5 Mon Sep 17 00:00:00 2001
From: Siri Hansen
Date: Wed, 7 May 2014 11:47:40 +0200
Subject: Fix minor bugs in gen_server and gen_fsm documentation
These are probably old copy-and-paste bugs from initial version of
this document.
---
lib/stdlib/doc/src/gen_fsm.xml | 10 ++++++----
lib/stdlib/doc/src/gen_server.xml | 2 +-
2 files changed, 7 insertions(+), 5 deletions(-)
(limited to 'lib/stdlib/doc/src')
diff --git a/lib/stdlib/doc/src/gen_fsm.xml b/lib/stdlib/doc/src/gen_fsm.xml
index 24468b0e8e..b1bba3eff0 100644
--- a/lib/stdlib/doc/src/gen_fsm.xml
+++ b/lib/stdlib/doc/src/gen_fsm.xml
@@ -118,7 +118,7 @@ gen_fsm:sync_send_all_state_event -----> Module:handle_sync_event/4
If FsmName={global,GlobalName} , the gen_fsm is
registered globally as GlobalName using
global:register_name/2 .
- If EventMgrName={via,Module,ViaName} , the event manager will
+ If FsmName={via,Module,ViaName} , the gen_fsm will
register with the registry represented by Module .
The Module callback should export the functions
register_name/2 , unregister_name/1 ,
@@ -246,7 +246,7 @@ gen_fsm:sync_send_all_state_event -----> Module:handle_sync_event/4
registered at another node, or
{global,GlobalName} , if the gen_fsm is globally
registered.
- {via,Module,ViaName} , if the event manager is registered
+ {via,Module,ViaName} , if the gen_fsm is registered
through an alternative process registry.
Event is an arbitrary term which is passed as one of
@@ -564,7 +564,8 @@ gen_fsm:sync_send_all_state_event -----> Module:handle_sync_event/4
Module:init/1 for a description of Timeout and hibernate .
If the function returns {stop,Reason,NewStateData} ,
the gen_fsm will call
- Module:terminate(Reason,NewStateData) and terminate.
+ Module:terminate(Reason,StateName,NewStateData) and
+ terminate.
@@ -650,7 +651,8 @@ gen_fsm:sync_send_all_state_event -----> Module:handle_sync_event/4
{stop,Reason,NewStateData} , any reply to From
must be given explicitly using gen_fsm:reply/2 .
The gen_fsm will then call
- Module:terminate(Reason,NewStateData) and terminate.
+ Module:terminate(Reason,StateName,NewStateData) and
+ terminate.
diff --git a/lib/stdlib/doc/src/gen_server.xml b/lib/stdlib/doc/src/gen_server.xml
index 4bef50245d..a915e567a5 100644
--- a/lib/stdlib/doc/src/gen_server.xml
+++ b/lib/stdlib/doc/src/gen_server.xml
@@ -116,7 +116,7 @@ gen_server:abcast -----> Module:handle_cast/2
registered globally as GlobalName using
global:register_name/2 . If no name is provided,
the gen_server is not registered.
- If EventMgrName={via,Module,ViaName} , the event manager will
+ If ServerName={via,Module,ViaName} , the gen_server will
register with the registry represented by Module .
The Module callback should export the functions
register_name/2 , unregister_name/1 ,
--
cgit v1.2.3
From 7adc2c36b0e839384baac50be35c0999d1e546df Mon Sep 17 00:00:00 2001
From: Anthony Ramine
Date: Sun, 25 May 2014 16:06:17 +0200
Subject: Implement ets:take/2
This new ETS BIF returns and deletes objects from tables.
---
lib/stdlib/doc/src/ets.xml | 15 +++++++++++++++
1 file changed, 15 insertions(+)
(limited to 'lib/stdlib/doc/src')
diff --git a/lib/stdlib/doc/src/ets.xml b/lib/stdlib/doc/src/ets.xml
index 3df24bf688..ef08f3c0cc 100644
--- a/lib/stdlib/doc/src/ets.xml
+++ b/lib/stdlib/doc/src/ets.xml
@@ -1586,6 +1586,21 @@ true
writing complicated Returns a list of all objects with the key
The given
Equivalent to
Removes trailing empty parts of the result (as does trim in
Removes all empty parts of the result.
Repeats the split until the
A supervisor assumes the definition of which child processes to - supervise to be located in a callback module exporting a +
A supervisor expects the definition of which child processes to + supervise to be specified in a callback module exporting a pre-defined set of functions.
Unless otherwise stated, all functions in this module will fail if the specified supervisor does not exist or if bad arguments @@ -53,18 +53,30 @@
The supervisor is responsible for starting, stopping and monitoring its child processes. The basic idea of a supervisor is - that it should keep its child processes alive by restarting them + that it shall keep its child processes alive by restarting them when necessary.
-The children of a supervisor is defined as a list of +
The children of a supervisor are defined as a list of child specifications. When the supervisor is started, the child processes are started in order from left to right according to this list. When the supervisor terminates, it first terminates its child processes in reversed start order, from right to left.
-A supervisor can have one of the following restart strategies:
+The properties of a supervisor are defined by the supervisor + flags. This is the type definition for the supervisor flags: +
+sup_flags() = #{strategy => strategy(), % optional
+ intensity => non_neg_integer(), % optional
+ period => pos_integer()} % optional
+
+ A supervisor can have one of the following restart
+ strategies, specified with the
Because a
Because a
To prevent a supervisor from getting into an infinite loop of
- child process terminations and restarts, a maximum restart frequency
- is defined using two integer values
This is the type definition of a child specification:
-
-child_spec() = {Id,StartFunc,Restart,Shutdown,Type,Modules}
- Id = term()
- StartFunc = {M,F,A}
- M = F = atom()
- A = [term()]
- Restart = permanent | transient | temporary
- Shutdown = brutal_kill | int()>0 | infinity
- Type = worker | supervisor
- Modules = [Module] | dynamic
- Module = atom()
+ child_spec() = #{id => child_id(), % mandatory
+ start => mfargs(), % mandatory
+ restart => restart(), % optional
+ shutdown => shutdown(), % optional
+ type => worker(), % optional
+ modules => modules()} % optional
+ The old tuple format is kept for backwards compatibility,
+ see
The
Note that this identifier on occations has been called + "name". As far as possible, the terms "identifier" or "id" + are now used but in order to keep backwards compatibility, + some occurences of "name" can still be found, for example + in error messages.
The start function must create and link to the child
- process, and should return
Note that the
The
The
If the child process is another supervisor,
If the child process is another supervisor, the shutdown time
should be set to
Be careful by setting the
Be careful when setting the shutdown time to
Note that all child processes implemented using the standard - OTP behavior modules automatically adhere to the shutdown + OTP behaviour modules automatically adhere to the shutdown protocol.
+The
The
The
Internally, the supervisor also keeps track of the pid
@@ -213,11 +248,20 @@ child_spec() = {Id,StartFunc,Restart,Shutdown,Type,Modules}
The tuple format is kept for backwards compatibility
+ only. A map is preferred; see more details
+ The value The tuple format is kept for backwards compatibility
+ only. A map is preferred; see more details
+
The created supervisor process calls
If
If
If no name is provided, the supervisor is not registered.
If the supervisor and its child processes are successfully
created (i.e. if all child process start functions return
-
If
If the case of a
In the case of a
If there already exists a child specification with
- the specified
If the child process start function returns
If the child process start function returns
If the child process start function returns an error tuple or
an erroneous value, or if it fails, the child specification is
- discarded and the function returns
If the child is temporary, the child specification is deleted as
soon as the process terminates. This means
- that
If successful, the function returns
See
See
Tells the supervisor
See
See
If successful, the function returns
Tells the supervisor
Note that for temporary children, the child specification - is automatically deleted when the child terminates, and thus + is automatically deleted when the child terminates; thus it is not possible to restart such children.
See
If the child process start function returns
If the child process start function returns an error tuple
or an erroneous value, or if it fails, the function returns
@@ -462,7 +511,7 @@ child_spec() = {Id,StartFunc,Restart,Shutdown,Type,Modules}
Returns a property list (see
See
Returns the child specification map for the child identified
+ by
See
The following functions should be exported from a +
The following functions must be exported from a
Whenever a supervisor is started using
Note that when the restart strategy is
The function may also return
Note that this function might also be called as a part of a
+ code upgrade procedure. For this reason, the function should
+ not have any side effects. See
+
The archive must be closed with
The
Writes the data with standard syntax in the same way as
Description:
+Returns a list corresponding to the given format string,
+ where control sequences have been replaced with
+ corresponding tuples. This list can be passed to
A typical use of this function is to replace unbounded-size
+ control sequences like
See
See
This function provides an efficient way to update one or more
@@ -1667,12 +1671,22 @@ true
If a default object
The function will fail with reason
These options are described in
As returned by
This function returns local date and time converted from
- the return value from
This function returns Universal Coordinated Time (UTC)
- converted from the return value from
Seeds random number generation with integer values in the process dictionary, and returns the old state.
-One way of obtaining a seed is to use the BIF
One easy way of obtaining a unique value to seed with is to:
- ...
- {A1,A2,A3} = now(),
- random:seed(A1, A2, A3),
- ...
+ random:seed(Calculates the time difference
Return the number of milliseconds in
Returns
Returns the elements of
Returns the elements of
Returns an set of the elements in
Returns a set of the elements in
Returns
Returns a new set formed from
Returns
Fold
This problem does not exist if all nodes are Erlang nodes.
-To avoid that late answers (after the timeout) pollutes +
To prevent late answers (after the timeout) from polluting the caller's message queue, a middleman process is used to do the actual calls. Late answers will then be discarded when they arrive to a terminated process.
-- cgit v1.2.3 From 5a19f97ebb036f7e9f6e2c735d9f52662b20a6a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?=
+ The call will fail with a
Example:
> Map = #{"hi" => 42},
@@ -95,8 +98,10 @@
Returns the value Value associated with Key if
Map contains Key .
- If no value is associated with Key then the call will
- fail with an exception.
+
+
+ The call will fail with a {badmap,Map} exception if Map is not a map,
+ or with a {badkey,Key} exception if no value is associated with Key .
Example:
@@ -116,6 +121,10 @@
Map contains Key .
If no value is associated with Key then returns Default .
+
+ The call will fail with a {badmap,Map} exception if Map is not a map.
+
+
Example:
> Map = #{ key1 => val1, key2 => val2 }.
@@ -134,7 +143,9 @@ val1
Returns true if map Map contains Key and returns
false if it does not contain the Key .
- The function will fail with an exception if Map is not a Map.
+
+
+ The call will fail with a {badmap,Map} exception if Map is not a map.
Example:
@@ -154,6 +165,9 @@ false
Returns a complete list of keys, in arbitrary order, which resides within Map .
+
+ The call will fail with a {badmap,Map} exception if Map is not a map.
+
Example:
> Map = #{42 => value_three,1337 => "value two","a" => 1},
@@ -189,6 +203,10 @@ false
Merges two maps into a single map Map3 . If two keys exists in both maps the
value in Map1 will be superseded by the value in Map2 .
+
+ The call will fail with a {badmap,Map} exception if Map1 or
+ Map2 is not a map.
+
Example:
> Map1 = #{a => "value_one", b => "value_two"},
@@ -222,6 +240,10 @@ false
replaced by value Value . The function returns a new map Map2 containing the new association and
the old associations in Map1 .
+
+ The call will fail with a {badmap,Map} exception if Map1 is not a map.
+
+
Example:
> Map = #{"a" => 1}.
@@ -241,6 +263,9 @@ false
The function removes the Key , if it exists, and its associated value from
Map1 and returns a new map Map2 without key Key .
+
+ The call will fail with a {badmap,Map} exception if Map1 is not a map.
+
Example:
> Map = #{"a" => 1}.
@@ -276,6 +301,9 @@ false
The fuction returns a list of pairs representing the key-value associations of Map ,
where the pairs, [{K1,V1}, ..., {Kn,Vn}] , are returned in arbitrary order.
+
+ The call will fail with a {badmap,Map} exception if Map is not a map.
+
Example:
> Map = #{42 => value_three,1337 => "value two","a" => 1},
@@ -291,8 +319,11 @@ false
If Key exists in Map1 the old associated value is
replaced by value Value . The function returns a new map Map2 containing
- the new associated value. If Key does not exist in Map1 an exception is
- generated.
+ the new associated value.
+
+
+ The call will fail with a {badmap,Map} exception if Map1 is not a map,
+ or with a {badkey,Key} exception if no value is associated with Key .
Example:
@@ -310,6 +341,9 @@ false
Returns a complete list of values, in arbitrary order, contained in map M .
+
+ The call will fail with a {badmap,Map} exception if Map is not a map.
+
Example:
> Map = #{42 => value_three,1337 => "value two","a" => 1},
--
cgit v1.2.3
From 3c2be863bde4965a1ac61092b1348b96397940cb Mon Sep 17 00:00:00 2001
From: Hans Bolinder
Date: Mon, 9 Mar 2015 16:25:00 +0100
Subject: stdlib: Add module erl_anno
Introduce erl_anno, an abstraction of the second element of tokens and
tuples in the abstract format. The convention that negative line
numbers can be used for silencing compiler warnings will no longer
work in OTP 19; instead the annotation 'generated' is to be used.
---
lib/stdlib/doc/src/Makefile | 3 +-
lib/stdlib/doc/src/erl_anno.xml | 308 +++++++++++++++++++++++++++++++++++++++
lib/stdlib/doc/src/erl_parse.xml | 98 ++++++++++++-
lib/stdlib/doc/src/ref_man.xml | 3 +-
lib/stdlib/doc/src/specs.xml | 1 +
5 files changed, 408 insertions(+), 5 deletions(-)
create mode 100644 lib/stdlib/doc/src/erl_anno.xml
(limited to 'lib/stdlib/doc/src')
diff --git a/lib/stdlib/doc/src/Makefile b/lib/stdlib/doc/src/Makefile
index f5d8b2072a..ce1e19a2a4 100644
--- a/lib/stdlib/doc/src/Makefile
+++ b/lib/stdlib/doc/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1997-2012. All Rights Reserved.
+# Copyright Ericsson AB 1997-2015. All Rights Reserved.
#
# The contents of this file are subject to the Erlang Public License,
# Version 1.1, (the "License"); you may not use this file except in
@@ -48,6 +48,7 @@ XML_REF3_FILES = \
digraph.xml \
digraph_utils.xml \
epp.xml \
+ erl_anno.xml \
erl_eval.xml \
erl_expand_records.xml \
erl_id_trans.xml \
diff --git a/lib/stdlib/doc/src/erl_anno.xml b/lib/stdlib/doc/src/erl_anno.xml
new file mode 100644
index 0000000000..281feacdc4
--- /dev/null
+++ b/lib/stdlib/doc/src/erl_anno.xml
@@ -0,0 +1,308 @@
+
+
+
+
+
+
+ 2015
+ 2015
+ Ericsson AB, All Rights Reserved
+
+
+ The contents of this file are subject to the Erlang Public License,
+ Version 1.1, (the "License"); you may not use this file except in
+ compliance with the License. You should have received a copy of the
+ Erlang Public License along with this software. If not, it can be
+ retrieved on line at http://www.erlang.org/.
+
+ Software distributed under the License is distributed on an "AS IS"
+ basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+ the License for the specific language governing rights and limitations
+ under the License.
+
+ The Initial Developer of the Original Code is Ericsson AB.
+
+
+ erl_anno
+ Hans Bolinder
+ Kenneth Lundin
+ 1
+
+
+ 2015-02-26
+ A
+ erl_anno.xml
+
+ erl_anno
+
+
+ Abstract Datatype for the Annotations of the Erlang Compiler
+
+
+
+ This module implements an abstract type that is used by the
+ Erlang Compiler and its helper modules for holding data such as
+ column, line number, and text. The data type is a collection of
+ annotations as
+ described in the following.
+ The Erlang Token Scanner returns tokens with a subset of
+ the following annotations, depending on the options:
+
+ column
+ The column where the token begins.
+ location
+ The line and column where the token begins, or
+ just the line if the column unknown.
+
+ text
+ The token's text.
+
+ From the above the following annotation is derived:
+
+ line
+ The line where the token begins.
+
+ Furthermore, the following annotations are supported by
+ this module, and used by various modules:
+
+ file
+ A filename.
+ generated
+ A Boolean indicating if the abstract code is
+ compiler generated. The Erlang Compiler does not emit warnings
+ for such code.
+
+ record
+ A Boolean indicating if the origin of the abstract
+ code is a record. Used by Dialyzer to assign types to tuple
+ elements.
+
+
+ The functions
+ column() ,
+ end_location() ,
+ line() ,
+ location() , and
+ text()
+ in the erl_scan module can be used for inspecting
+ annotations in tokens.
+ The functions
+ map_anno() ,
+ fold_anno() ,
+ mapfold_anno() ,
+ new_anno() ,
+
+ anno_from_term() , and
+
+ anno_to_term() in the erl_parse module can be
+ used for manipulating annotations in abstract code.
+
+
+
+
+
+ anno()
+ A collection of annotations.
+
+
+
+
+
+ The term representing a collection of annotations. It is
+ either a location() or a list of key-value pairs.
+
+
+
+
+
+
+
+
+ To be changed to a non-negative integer in Erlang/OTP 19.0.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Return the column
+
+ Returns the column of the annotations Anno .
+
+
+
+
+
+
+ Return the end location of the text
+
+ Returns the end location of the text of the
+ annotations Anno . If there is no text,
+ undefined is returned.
+
+
+
+
+
+
+ Return the filename
+
+ Returns the filename of the annotations Anno .
+ If there is no filename, undefined is returned.
+
+
+
+
+
+ Return annotations given a term
+
+ Returns annotations with the representation Term .
+
+
+ See also to_term() .
+
+
+
+
+
+
+ Return the generated Boolean
+
+ Returns true if the annotations Anno
+ has been marked as generated. The default is to return
+ false .
+
+
+
+
+
+ Test for a collection of annotations
+
+ Returns true if Term is a collection of
+ annotations, false otherwise.
+
+
+
+
+
+ Return the line
+
+ Returns the line of the annotations Anno .
+
+
+
+
+
+
+ Return the location
+
+ Returns the location of the annotations Anno .
+
+
+
+
+
+
+ Create a new collection of annotations
+
+ Creates a new collection of annotations given a location.
+
+
+
+
+
+ Modify the filename
+
+ Modifies the filename of the annotations Anno .
+
+
+
+
+
+
+ Modify the generated marker
+
+ Modifies the generated marker of the annotations
+ Anno .
+
+
+
+
+
+
+ Modify the line
+
+ Modifies the line of the annotations Anno .
+
+
+
+
+
+
+ Modify the location
+
+ Modifies the location of the annotations Anno .
+
+
+
+
+
+
+ Modify the record marker
+
+ Modifies the record marker of the annotations Anno .
+
+
+
+
+
+
+ Modify the text
+
+ Modifies the text of the annotations Anno .
+
+
+
+
+
+
+ Return the text
+
+ Returns the text of the annotations Anno .
+ If there is no text, undefined is returned.
+
+
+
+
+
+ Return the term representing a collection of
+ annotations
+
+ Returns the term representing the annotations Anno .
+
+ See also from_term() .
+
+
+
+
+
+ See Also
+ erl_scan(3) ,
+ erl_parse(3)
+
+
+
diff --git a/lib/stdlib/doc/src/erl_parse.xml b/lib/stdlib/doc/src/erl_parse.xml
index cf0bff48cd..b97d06e919 100644
--- a/lib/stdlib/doc/src/erl_parse.xml
+++ b/lib/stdlib/doc/src/erl_parse.xml
@@ -4,7 +4,7 @@
- 1996 2014
+ 1996 2015
Ericsson AB. All Rights Reserved.
@@ -192,6 +192,97 @@
considered a string.
Modifies the abstract form
Updates an accumulator by applying
Modifies the abstract form
Creates an abstract form from a term which has the same
+ structure as an abstract form, but
Assumes that
Returns a term where every collection of annotations Anno of
+
A token is a tuple containing information about
syntactic category, the token attributes, and the actual
terminal symbol. For punctuation characters (e.g.
Returns the category of
Returns the symbol of
Returns the column of
Returns the end location of the text of
+
Returns the line of
Returns the location of
Returns the text of
Random number generator.
+ +The module contains several different algorithms and can be
+ extended with more in the future. The current uniform
+ distribution algorithms uses the
+
The implemented algorithms are:
+The current default algorithm is
Every time a random number is requested, a state is used to + calculate it and a new state produced. The state can either be + implicit or it can be an explicit argument and return value. +
+ +The functions with implicit state use the process dictionary
+ variable
If a process calls
The functions with explicit state never use the process + dictionary.
+ +Examples:
+
+ %% Simple usage. Creates and seeds the default algorithm
+ %% with a non-constant seed if not already done.
+ R0 = rand:uniform(),
+ R1 = rand:uniform(),
+
+ %% Use a given algorithm.
+ _ = rand:seed(exs1024),
+ R2 = rand:uniform(),
+
+ %% Use a given algorithm with a constant seed.
+ _ = rand:seed(exs1024, {123, 123534, 345345}),
+ R3 = rand:uniform(),
+
+ %% Use the functional api with non-constant seed.
+ S0 = rand:seed_s(exsplus),
+ {R4, S1} = rand:uniform_s(S0),
+
+ %% Create a standard normal deviate.
+ {SND0, S2} = rand:normal_s(S1),
+
+
+ This random number generator is not cryptographically
+ strong. If a strong cryptographic random number generator is
+ needed, use one of functions in the
+
Algorithm dependent state.
Algorithm dependent state which can be printed or saved to file.
Seeds random number generation with the given algorithm and time dependent
+ data if
Otherwise recreates the exported seed in the process
+ dictionary, and returns the state.
+ See also:
Seeds random number generation with the given algorithm and time dependent
+ data if
Otherwise recreates the exported seed and returns the state.
+ See also:
Seeds random number generation with the given algorithm and + integers in the process dictionary and returns + the state.
+Seeds random number generation with the given algorithm and + integers and returns the state.
+Returns the random number state in an external format.
+ To be used with
Returns the random number generator state in an external format.
+ To be used with
Returns a random float uniformly distributed in the value
+ range
Given a state,
Given an integer
Given an integer
Returns a standard normal deviate float (that is, the mean + is 0 and the standard deviation is 1) and updates the state in + the process dictionary.
+Given a state,
It should be noted that this random number generator is not cryptographically
strong. If a strong cryptographic random number generator is needed for
example
The new and improved
Example:
-- cgit v1.2.3 From 5c192ac2faf510c24a4f9c9936dd580d5d304183 Mon Sep 17 00:00:00 2001 From: Bruce YinheDate: Fri, 20 Mar 2015 15:25:00 +0100 Subject: Fixed a typo in Maps doc --- lib/stdlib/doc/src/maps.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/stdlib/doc/src') diff --git a/lib/stdlib/doc/src/maps.xml b/lib/stdlib/doc/src/maps.xml index 59c26d9896..e46068230a 100644 --- a/lib/stdlib/doc/src/maps.xml +++ b/lib/stdlib/doc/src/maps.xml @@ -339,7 +339,7 @@ false + - Returns a complete list of values, in arbitrary order, contained in map
M . + Returns a complete list of values, in arbitrary order, contained in mapMap .The call will fail with a
{badmap,Map} exception ifis not a map. -- cgit v1.2.3 From 6e24ffab6c682383a1c284fc066e59c680c4c62e Mon Sep 17 00:00:00 2001 From: Richard Carlsson Map Date: Mon, 20 Apr 2015 09:51:49 +0200 Subject: Add uptime() shell command --- lib/stdlib/doc/src/c.xml | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'lib/stdlib/doc/src') diff --git a/lib/stdlib/doc/src/c.xml b/lib/stdlib/doc/src/c.xml index b49fa6ad67..b43d4786ae 100644 --- a/lib/stdlib/doc/src/c.xml +++ b/lib/stdlib/doc/src/c.xml @@ -231,6 +231,14 @@ compile:file( File ,Options ++ [report_errors, report_w in the network.+ + Print node uptime ++ +Prints the node uptime (as given by +
+erlang:statistics(wall_clock) ), in human-readable form.xm(ModSpec) -> void() Cross reference check a module -- cgit v1.2.3 From e09dd66dc4d89c62ddfd8c19791f9678d5d787c6 Mon Sep 17 00:00:00 2001 From: Erlang/OTPDate: Tue, 12 May 2015 18:18:55 +0200 Subject: Prepare release --- lib/stdlib/doc/src/notes.xml | 218 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 218 insertions(+) (limited to 'lib/stdlib/doc/src') diff --git a/lib/stdlib/doc/src/notes.xml b/lib/stdlib/doc/src/notes.xml index 301a5ee2e8..3914a9bc0e 100644 --- a/lib/stdlib/doc/src/notes.xml +++ b/lib/stdlib/doc/src/notes.xml @@ -30,6 +30,224 @@
This document describes the changes made to the STDLIB application.
++ Fix handling of single dot in filename:join/2
++ The reference manual says that filename:join(A,B) is + equivalent to filename:join([A,B]). In some rare cases + this turns out not to be true. For example:
+
+
+ This has been corrected. A single dot is now only kept if + it occurs at the very beginning or the very end of the + resulting path.
++ *** POTENTIAL INCOMPATIBILITY ***
++ Own Id: OTP-12158
+
+ The undocumented option
+ Own Id: OTP-12183
++ erl_lint:icrt_export/4 has been rewritten to make the + code really follow the scoping rules of Erlang, and not + just in most situations by accident.
++ Own Id: OTP-12186
++ Add 'trim_all' option to binary:split/3
++ This option can be set to remove _ALL_ empty parts of the + result of a call to binary:split/3.
++ Own Id: OTP-12301
+ Correct orddict(3) regarding evaluation order of
+
+ Own Id: OTP-12651 Aux Id: seq12832
+
+ Correct
+ Bad input to maps module function will now yield the
+ following exceptions:
+ Own Id: OTP-12657
++ It is now possible to paste text in JCL mode (using + Ctrl-Y) that has been copied in the previous shell + session. Also a bug that caused the JCL mode to crash + when pasting text has been fixed.
++ Own Id: OTP-12673
++ Allow maps for supervisor flags and child specs
+
+ Earlier, supervisor flags and child specs were given as
+ tuples. While this is kept for backwards compatibility,
+ it is now also allowed to give these parameters as maps,
+ see
+ Own Id: OTP-11043
+
+ A new system message,
+ The new function
+
+
+ Own Id: OTP-11173 Aux Id: seq12353
+
+ Remove the
+ Own Id: OTP-11907
+
+ New BIF:
+ *** POTENTIAL INCOMPATIBILITY ***
++ Own Id: OTP-12151 Aux Id: seq12521
+ Add three new functions to
+ Own Id: OTP-12167
+ Introduce the
+ Own Id: OTP-12195
++ Support variables as Map keys in expressions and patterns
+Erlang will accept any expression as keys in Map + expressions and it will accept literals or bound + variables as keys in Map patterns.
++ Own Id: OTP-12218
+The last traces of Mnemosyne Rules have been removed. +
++ Own Id: OTP-12257
++ Properly support maps in match_specs
++ Own Id: OTP-12270
+
+ New function
+ Own Id: OTP-12309
++ Own Id: OTP-12422 Aux Id: seq12774
++ Prevent zip:zip_open/[12] from leaking file descriptors + if parent process dies.
++ Own Id: OTP-12566
+
+ Add a new random number generator, see
+ Own Id: OTP-12586 Aux Id: OTP-12501, OTP-12502
++ Own Id: OTP-12716
+This document describes the changes made to the STDLIB application.
-- Fix handling of single dot in filename:join/2
-- The reference manual says that filename:join(A,B) is - equivalent to filename:join([A,B]). In some rare cases - this turns out not to be true. For example:
-
-
- This has been corrected. A single dot is now only kept if - it occurs at the very beginning or the very end of the - resulting path.
-- *** POTENTIAL INCOMPATIBILITY ***
-- Own Id: OTP-12158
-
- The undocumented option
- Own Id: OTP-12183
-- erl_lint:icrt_export/4 has been rewritten to make the - code really follow the scoping rules of Erlang, and not - just in most situations by accident.
-- Own Id: OTP-12186
-- Add 'trim_all' option to binary:split/3
-- This option can be set to remove _ALL_ empty parts of the - result of a call to binary:split/3.
-- Own Id: OTP-12301
- Correct orddict(3) regarding evaluation order of
-
- Own Id: OTP-12651 Aux Id: seq12832
-
- Correct
- Bad input to maps module function will now yield the
- following exceptions:
- Own Id: OTP-12657
-- It is now possible to paste text in JCL mode (using - Ctrl-Y) that has been copied in the previous shell - session. Also a bug that caused the JCL mode to crash - when pasting text has been fixed.
-- Own Id: OTP-12673
-- Allow maps for supervisor flags and child specs
-
- Earlier, supervisor flags and child specs were given as
- tuples. While this is kept for backwards compatibility,
- it is now also allowed to give these parameters as maps,
- see
- Own Id: OTP-11043
-
- A new system message,
- The new function
-
-
- Own Id: OTP-11173 Aux Id: seq12353
-
- Remove the
- Own Id: OTP-11907
-
- New BIF:
- *** POTENTIAL INCOMPATIBILITY ***
-- Own Id: OTP-12151 Aux Id: seq12521
- Add three new functions to
- Own Id: OTP-12167
- Introduce the
- Own Id: OTP-12195
-- Support variables as Map keys in expressions and patterns
-Erlang will accept any expression as keys in Map - expressions and it will accept literals or bound - variables as keys in Map patterns.
-- Own Id: OTP-12218
-The last traces of Mnemosyne Rules have been removed. -
-- Own Id: OTP-12257
-- Properly support maps in match_specs
-- Own Id: OTP-12270
-
- New function
- Own Id: OTP-12309
-- Own Id: OTP-12422 Aux Id: seq12774
-- Prevent zip:zip_open/[12] from leaking file descriptors - if parent process dies.
-- Own Id: OTP-12566
-
- Add a new random number generator, see
- Own Id: OTP-12586 Aux Id: OTP-12501, OTP-12502
-- Own Id: OTP-12716
-Whenever the
The
Returns an iterator that can be used for traversing the
+ entries of
Returns an iterator that can be used for traversing the
+ entries of
+ Returns a map
+ The call will fail with a
Example:
+
+> M = #{a => 2, b => 3, c=> 4, "a" => 1, "b" => 2, "c" => 4},
+ Pred = fun(K,V) -> is_atom(K) andalso (V rem 2) =:= 0 end,
+ maps:filter(Pred,M).
+#{a => 2,c => 4}
+ If Unicode file names are enabled, the calls to
If the child process start function returns
In the case of a
If the child process start function returns an error tuple or
an erroneous value, or if it fails, the child specification is
discarded, and the function returns As returned by new/0. Dictionary as returned by The include file These macros are defined in the Stdlib include file
+ When an assertion succeeds, the assert macro yields the atom
+ If the macro For example, using (The value of A few other macros also have effect on the enabling or disabling of
+ assertions: If you prefer, you can thus use only Tests that Tests that Tests that Note that a guard Tests that As in Tests that Tests that Tests that Note that both Tests that As in Equivalent to Equivalent to Equivalent to
+-include_lib("stdlib/include/assert.hrl").
+
+erlc -DNOASSERT=true *.erl
+
+
+
+ ?assertMatch({bork, _}, f())
+ ?assertMatch({bork, X} when X > 0, f())
This document describes the changes made to the STDLIB application.
++ Fix handling of single dot in filename:join/2
++ The reference manual says that filename:join(A,B) is + equivalent to filename:join([A,B]). In some rare cases + this turns out not to be true. For example:
+
+
+ This has been corrected. A single dot is now only kept if + it occurs at the very beginning or the very end of the + resulting path.
++ *** POTENTIAL INCOMPATIBILITY ***
++ Own Id: OTP-12158
+
+ The undocumented option
+ Own Id: OTP-12183
++ erl_lint:icrt_export/4 has been rewritten to make the + code really follow the scoping rules of Erlang, and not + just in most situations by accident.
++ Own Id: OTP-12186
++ Add 'trim_all' option to binary:split/3
++ This option can be set to remove _ALL_ empty parts of the + result of a call to binary:split/3.
++ Own Id: OTP-12301
+ Correct orddict(3) regarding evaluation order of
+
+ Own Id: OTP-12651 Aux Id: seq12832
+
+ Correct
+ Bad input to maps module function will now yield the
+ following exceptions:
+ Own Id: OTP-12657
++ It is now possible to paste text in JCL mode (using + Ctrl-Y) that has been copied in the previous shell + session. Also a bug that caused the JCL mode to crash + when pasting text has been fixed.
++ Own Id: OTP-12673
+
+ Add
+ Own Id: OTP-12752
++ Cache nowarn_bif_clash functions in erl_lint.
++ This patch stores nowarn_bif_clash in the lint record. By + using erlc +'{eprof,lint_module}' when compiling the + erlang parser, we noticed the time spent on + nowarn_function/2 reduced from 30% to 0.01%.
++ Own Id: OTP-12754
++ Optimize the Erlang Code Linter by using the cached + filename information.
++ Own Id: OTP-12772
++ If a child of a simple_one_for_one returns ignore from + its start function no longer store the child for any + restart type. It is not possible to restart or delete the + child because the supervisor is a simple_one_for_one.
++ Own Id: OTP-12793
+
+ Make
+ Own Id: OTP-12814
++ There are many cases where user code needs to be able to + distinguish between a socket that was closed normally and + one that was aborted. Setting the option + {show_econnreset, true} enables the user to receive + ECONNRESET errors on both active and passive sockets.
++ Own Id: OTP-12841
++ Allow maps for supervisor flags and child specs
+
+ Earlier, supervisor flags and child specs were given as
+ tuples. While this is kept for backwards compatibility,
+ it is now also allowed to give these parameters as maps,
+ see
+ Own Id: OTP-11043
+
+ A new system message,
+ The new function
+
+
+ Own Id: OTP-11173 Aux Id: seq12353
+
+ Remove the
+ Own Id: OTP-11907
+
+ New BIF:
+ *** POTENTIAL INCOMPATIBILITY ***
++ Own Id: OTP-12151 Aux Id: seq12521
+ Add three new functions to
+ Own Id: OTP-12167
+ Introduce the
+ Own Id: OTP-12195
++ Support variables as Map keys in expressions and patterns
+Erlang will accept any expression as keys in Map + expressions and it will accept literals or bound + variables as keys in Map patterns.
++ Own Id: OTP-12218
+The last traces of Mnemosyne Rules have been removed. +
++ Own Id: OTP-12257
++ Properly support maps in match_specs
++ Own Id: OTP-12270
+
+ New function
+ Own Id: OTP-12309
++ Own Id: OTP-12422 Aux Id: seq12774
+The documentation of the Abstract Format (in the ERTS + User's Guide) has been updated with types and + specification. (Thanks to Anthony Ramine.)
The
+ explicit representation of parentheses used in types of
+ the abstract format has been removed. Instead the new
+ functions
+ Own Id: OTP-12492
++ Prevent zip:zip_open/[12] from leaking file descriptors + if parent process dies.
++ Own Id: OTP-12566
+
+ Add a new random number generator, see
+ Own Id: OTP-12586 Aux Id: OTP-12501, OTP-12502
++ Own Id: OTP-12716
+
+ Add
+ Own Id: OTP-12737 Aux Id: seq12805
+ Add functions
+ Own Id: OTP-12742
+
+ Add
+ Own Id: OTP-12745
++ Change some internal data structures to Maps in order to + speed up compilation time. Measured speed up is around + 10%-15%.
++ Own Id: OTP-12774
+ Update
+ Own Id: OTP-12785
+The assert macros in
+ Own Id: OTP-12808
+Returns the last key
Use