aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib/doc/src/notes.xml
diff options
context:
space:
mode:
Diffstat (limited to 'lib/stdlib/doc/src/notes.xml')
-rw-r--r--lib/stdlib/doc/src/notes.xml602
1 files changed, 573 insertions, 29 deletions
diff --git a/lib/stdlib/doc/src/notes.xml b/lib/stdlib/doc/src/notes.xml
index 301a5ee2e8..5d4f9d912f 100644
--- a/lib/stdlib/doc/src/notes.xml
+++ b/lib/stdlib/doc/src/notes.xml
@@ -8,16 +8,17 @@
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
- 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 online 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.
+ 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
+ distributed under the License is distributed on an "AS IS" BASIS,
+ 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>
@@ -30,6 +31,542 @@
</header>
<p>This document describes the changes made to the STDLIB application.</p>
+<section><title>STDLIB 2.8</title>
+
+ <section><title>Fixed Bugs and Malfunctions</title>
+ <list>
+ <item>
+ <p>
+ Fix evaluation in matching of bound map key variables in
+ the interpreter.</p>
+ <p>
+ Prior to this patch, the following code would not
+ evaluate: <c>X = key,(fun(#{X := value}) -&gt; true
+ end)(#{X => value})</c></p>
+ <p>
+ Own Id: OTP-13218</p>
+ </item>
+ <item>
+ <p> Fix <c>erl_eval</c> not using non-local function
+ handler. </p>
+ <p>
+ Own Id: OTP-13228 Aux Id: ERL-32 </p>
+ </item>
+ <item>
+ <p> The Erlang Code Linter no longer crashes if there is
+ a <c>-deprecated()</c> attribute but no <c>-module()</c>
+ declaration. </p>
+ <p>
+ Own Id: OTP-13230 Aux Id: ERL-62 </p>
+ </item>
+ <item>
+ <p>
+ The timestamp in the result returned by <c>dets:info(Tab,
+ safe_fixed)</c> was unintentionally broken as a result of
+ the time API rewrites in OTP 18.0. This has now been
+ fixed.</p>
+ <p>
+ Own Id: OTP-13239 Aux Id: OTP-11997 </p>
+ </item>
+ <item>
+ <p>A rare race condition in <c>beam_lib</c> when using
+ encrypted abstract format has been eliminated.</p>
+ <p>
+ Own Id: OTP-13278</p>
+ </item>
+ <item>
+ <p>
+ Improved maps:with/2 and maps:without/2 algorithms</p>
+ <p>
+ The new implementation speeds up the execution
+ significantly for all sizes of input.</p>
+ <p>
+ Own Id: OTP-13376</p>
+ </item>
+ </list>
+ </section>
+
+
+ <section><title>Improvements and New Features</title>
+ <list>
+ <item>
+ <p>
+ Time warp safety improvements.</p>
+ <p>
+ Introduced the options <c>monotonic_timestamp</c>, and
+ <c>strict_monotonic_timestamp</c> to the trace,
+ sequential trace, and system profile functionality. This
+ since the already existing <c>timestamp</c> option is not
+ time warp safe.</p>
+ <p>
+ Introduced the option <c>safe_fixed_monotonic_time</c> to
+ <c>ets:info/2</c> and <c>dets:info/2</c>. This since the
+ already existing <c>safe_fixed</c> option is not time
+ warp safe.</p>
+ <p>
+ Own Id: OTP-13222 Aux Id: OTP-11997 </p>
+ </item>
+ <item>
+ <p>
+ In the shell Ctrl+W (delete word) will no longer consider
+ "." as being part of a word.</p>
+ <p>
+ Own Id: OTP-13281</p>
+ </item>
+ </list>
+ </section>
+
+</section>
+
+<section><title>STDLIB 2.7</title>
+
+ <section><title>Fixed Bugs and Malfunctions</title>
+ <list>
+ <item>
+ <p>The Erlang Pretty Printer uses <c>::</c> for function
+ type constraints.</p> <p>A bug concerning pretty printing
+ of annotated type union elements in map pair types has
+ been fixed.</p> <p>Some minor issues regarding the
+ documentation of types and specs have been corrected.</p>
+ <p>
+ Own Id: OTP-13084</p>
+ </item>
+ <item>
+ <p> The shell command <c>rp</c> prints strings as lists
+ of integers if pretty printing of lists is set to
+ <c>false</c>. </p>
+ <p>
+ Own Id: OTP-13145</p>
+ </item>
+ <item>
+ <p>
+ The shell would crash if a bit syntax expression with
+ conflicting types were given (e.g. if a field type was
+ given as '<c>integer-binary</c>'). (Thanks to Aleksei
+ Magusev for reporting this bug.)</p>
+ <p>
+ Own Id: OTP-13157</p>
+ </item>
+ <item>
+ <p>The <c>rand:export_seed/0</c> would never return
+ '<c>undefined</c>' even if no seed has previously been
+ created. Fixed to return '<c>undefined</c>' if there is
+ no seed in the process dictionary.</p>
+ <p>
+ Own Id: OTP-13162</p>
+ </item>
+ </list>
+ </section>
+
+
+ <section><title>Improvements and New Features</title>
+ <list>
+ <item>
+ <p>
+ Add support for the Delete, Home and End keys in the
+ Erlang shell.</p>
+ <p>
+ Own Id: OTP-13032</p>
+ </item>
+ <item>
+ <p><c>beam_lib:all_chunks/1</c> and
+ <c>beam_lib:build_module/1</c> have been documented.</p>
+ <p>
+ Own Id: OTP-13063</p>
+ </item>
+ </list>
+ </section>
+
+</section>
+
+<section><title>STDLIB 2.6</title>
+
+ <section><title>Fixed Bugs and Malfunctions</title>
+ <list>
+ <item>
+ <p> In OTP 18.0, <c>qlc</c> does not handle syntax errors
+ well. This bug has been fixed. </p>
+ <p>
+ Own Id: OTP-12946</p>
+ </item>
+ <item>
+ <p>
+ Optimize zip:unzip/2 when uncompressing to memory.</p>
+ <p>
+ Own Id: OTP-12950</p>
+ </item>
+ <item>
+ <p>
+ The <c>stdlib</c> reference manual is updated to show
+ correct information about the return value of
+ <c>gen_fsm:reply/2</c>.</p>
+ <p>
+ Own Id: OTP-12973</p>
+ </item>
+ <item>
+ <p>re:split2,3 and re:replace/3,4 now correctly handles
+ pre-compiled patterns that have been compiled using the
+ '<c>unicode</c>' option.</p>
+ <p>
+ Own Id: OTP-12977</p>
+ </item>
+ <item>
+ <p>
+ Export <c>shell:catch_exception/1</c> as documented.</p>
+ <p>
+ Own Id: OTP-12990</p>
+ </item>
+ </list>
+ </section>
+
+
+ <section><title>Improvements and New Features</title>
+ <list>
+ <item>
+ <p>A mechanism for limiting the amount of text that the
+ built-in error logger events will produce has been
+ introduced. It is useful for limiting both the size of
+ log files and the CPU time used to produce them.</p>
+ <p>This mechanism is experimental in the sense that it
+ may be changed if it turns out that it does not solve the
+ problem it is supposed to solve. In that case, there may
+ be backward incompatible improvements to this
+ mechanism.</p>
+ <p>See the documentation for the config parameter
+ <c>error_logger_format_depth</c> in the Kernel
+ application for information about how to turn on this
+ feature.</p>
+ <p>
+ Own Id: OTP-12864</p>
+ </item>
+ </list>
+ </section>
+
+</section>
+
+<section><title>STDLIB 2.5</title>
+
+ <section><title>Fixed Bugs and Malfunctions</title>
+ <list>
+ <item>
+ <p>
+ Fix handling of single dot in filename:join/2</p>
+ <p>
+ 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:</p>
+ <p>
+ <c>filename:join("/a/.","b") -&gt; "/a/./b"</c> vs
+ <c>filename:join(["/a/.","b"]) -&gt; "/a/b"</c>.</p>
+ <p>
+ 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.</p>
+ <p>
+ *** POTENTIAL INCOMPATIBILITY ***</p>
+ <p>
+ Own Id: OTP-12158</p>
+ </item>
+ <item>
+ <p>
+ The undocumented option <c>generic_debug</c> for
+ <c>gen_server</c> has been removed.</p>
+ <p>
+ Own Id: OTP-12183</p>
+ </item>
+ <item>
+ <p>
+ 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.</p>
+ <p>
+ Own Id: OTP-12186</p>
+ </item>
+ <item>
+ <p>
+ Add 'trim_all' option to binary:split/3</p>
+ <p>
+ This option can be set to remove _ALL_ empty parts of the
+ result of a call to binary:split/3.</p>
+ <p>
+ Own Id: OTP-12301</p>
+ </item>
+ <item>
+ <p> Correct orddict(3) regarding evaluation order of
+ <c>fold()</c> and <c>map()</c>. </p>
+ <p>
+ Own Id: OTP-12651 Aux Id: seq12832 </p>
+ </item>
+ <item>
+ <p>
+ Correct <c>maps</c> module error exceptions </p>
+ <p>
+ Bad input to maps module function will now yield the
+ following exceptions:</p>
+ <list> <item>{badmap, NotMap}, or </item> <item>badarg.</item>
+ </list>
+ <p>
+ Own Id: OTP-12657</p>
+ </item>
+ <item>
+ <p>
+ 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.</p>
+ <p>
+ Own Id: OTP-12673</p>
+ </item>
+ <item>
+ <p>
+ Add <c>uptime()</c> shell command.</p>
+ <p>
+ Own Id: OTP-12752</p>
+ </item>
+ <item>
+ <p>
+ Cache nowarn_bif_clash functions in erl_lint.</p>
+ <p>
+ 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%.</p>
+ <p>
+ Own Id: OTP-12754</p>
+ </item>
+ <item>
+ <p>
+ Optimize the Erlang Code Linter by using the cached
+ filename information.</p>
+ <p>
+ Own Id: OTP-12772</p>
+ </item>
+ <item>
+ <p>
+ 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.</p>
+ <p>
+ Own Id: OTP-12793</p>
+ </item>
+ <item>
+ <p>
+ Make <c>ets:file2tab</c> preserve enabled
+ <c>read_concurrency</c> and <c>write_concurrency</c>
+ options for tables.</p>
+ <p>
+ Own Id: OTP-12814</p>
+ </item>
+ <item>
+ <p>
+ 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.</p>
+ <p>
+ Own Id: OTP-12841</p>
+ </item>
+ </list>
+ </section>
+
+
+ <section><title>Improvements and New Features</title>
+ <list>
+ <item>
+ <p>
+ Allow maps for supervisor flags and child specs</p>
+ <p>
+ 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 <seealso
+ marker="stdlib:supervisor#sup_flags">sup_flags</seealso>
+ and <seealso
+ marker="stdlib:supervisor#child_spec">child_spec</seealso>.</p>
+ <p>
+ Own Id: OTP-11043</p>
+ </item>
+ <item>
+ <p>
+ A new system message, <c>terminate</c>, is added. This
+ can be sent with <c>sys:terminate/2,3</c>. If the
+ receiving process handles system messages properly it
+ will terminate shortly after receiving this message.</p>
+ <p>
+ The new function <c>proc_lib:stop/1,3</c> utilizes this
+ new system message and monitors the receiving process in
+ order to facilitate a synchronous stop mechanism for
+ 'special processes'.</p>
+ <p>
+ <c>proc_lib:stop/1,3</c> is used by the following
+ functions:</p>
+ <list> <item><c>gen_server:stop/1,3</c> (new)</item>
+ <item><c>gen_fsm:stop/1,3</c> (new)</item>
+ <item><c>gen_event:stop/1,3</c> (modified to be
+ synchronous)</item> <item><c>wx_object:stop/1,3</c>
+ (new)</item> </list>
+ <p>
+ Own Id: OTP-11173 Aux Id: seq12353 </p>
+ </item>
+ <item>
+ <p>
+ Remove the <c>pg</c> module, which has been deprecated
+ through OTP-17, is now removed from the STDLIB
+ application. This module has been marked experimental for
+ more than 15 years, and has largely been superseded by
+ the <c>pg2</c> module from the Kernel application.</p>
+ <p>
+ Own Id: OTP-11907</p>
+ </item>
+ <item>
+ <p>
+ New BIF: <c>erlang:get_keys/0</c>, lists all keys
+ associated with the process dictionary. Note:
+ <c>erlang:get_keys/0</c> is auto-imported.</p>
+ <p>
+ *** POTENTIAL INCOMPATIBILITY ***</p>
+ <p>
+ Own Id: OTP-12151 Aux Id: seq12521 </p>
+ </item>
+ <item>
+ <p> Add three new functions to <c>io_lib</c>--
+ <c>scan_format/2</c>, <c>unscan_format/1</c>, and
+ <c>build_text/1</c>-- which expose the parsed form of the
+ format control sequences to make it possible to easily
+ modify or filter the input to <c>io_lib:format/2</c>.
+ This can e.g. be used in order to replace unbounded-size
+ control sequences like <c>~w</c> or <c>~p</c> with
+ corresponding depth-limited <c>~W</c> and <c>~P</c>
+ before doing the actual formatting. </p>
+ <p>
+ Own Id: OTP-12167</p>
+ </item>
+ <item>
+ <p> Introduce the <c>erl_anno</c> module, an abstraction
+ of the second element of tokens and tuples in the
+ abstract format. </p>
+ <p>
+ Own Id: OTP-12195</p>
+ </item>
+ <item>
+ <p>
+ Support variables as Map keys in expressions and patterns</p>
+ <p>Erlang will accept any expression as keys in Map
+ expressions and it will accept literals or bound
+ variables as keys in Map patterns.</p>
+ <p>
+ Own Id: OTP-12218</p>
+ </item>
+ <item>
+ <p> The last traces of Mnemosyne Rules have been removed.
+ </p>
+ <p>
+ Own Id: OTP-12257</p>
+ </item>
+ <item>
+ <p>
+ Properly support maps in match_specs</p>
+ <p>
+ Own Id: OTP-12270</p>
+ </item>
+ <item>
+ <p>
+ New function <c>ets:take/2</c>. Works the same as
+ <c>ets:delete/2</c> but also returns the deleted
+ object(s).</p>
+ <p>
+ Own Id: OTP-12309</p>
+ </item>
+ <item>
+ <p><c>string:tokens/2</c> is somewhat faster, especially
+ if the list of separators only contains one separator
+ character.</p>
+ <p>
+ Own Id: OTP-12422 Aux Id: seq12774 </p>
+ </item>
+ <item>
+ <p>The documentation of the Abstract Format (in the ERTS
+ User's Guide) has been updated with types and
+ specification. (Thanks to Anthony Ramine.) </p> <p> The
+ explicit representation of parentheses used in types of
+ the abstract format has been removed. Instead the new
+ functions <c>erl_parse:type_inop_prec()</c> and
+ <c>erl_parse:type_preop_prec()</c> can be used for
+ inserting parentheses where needed. </p>
+ <p>
+ Own Id: OTP-12492</p>
+ </item>
+ <item>
+ <p>
+ Prevent zip:zip_open/[12] from leaking file descriptors
+ if parent process dies.</p>
+ <p>
+ Own Id: OTP-12566</p>
+ </item>
+ <item>
+ <p>
+ Add a new random number generator, see <c>rand</c>
+ module. It have better characteristics and an improved
+ interface.</p>
+ <p>
+ Own Id: OTP-12586 Aux Id: OTP-12501, OTP-12502 </p>
+ </item>
+ <item>
+ <p><c>filename:split/1</c> when given an empty binary
+ will now return an empty list, to make it consistent with
+ return value when given an empty list.</p>
+ <p>
+ Own Id: OTP-12716</p>
+ </item>
+ <item>
+ <p>
+ Add <c>sync</c> option to <c>ets:tab2file/3</c>.</p>
+ <p>
+ Own Id: OTP-12737 Aux Id: seq12805 </p>
+ </item>
+ <item>
+ <p> Add functions <c>gb_sets:iterator_from()</c> and
+ <c>gb_trees:iterator_from()</c>. (Thanks to Kirill
+ Kinduk.) </p>
+ <p>
+ Own Id: OTP-12742</p>
+ </item>
+ <item>
+ <p>
+ Add <c>maps:filter/2</c> to maps module.</p>
+ <p>
+ Own Id: OTP-12745</p>
+ </item>
+ <item>
+ <p>
+ Change some internal data structures to Maps in order to
+ speed up compilation time. Measured speed up is around
+ 10%-15%.</p>
+ <p>
+ Own Id: OTP-12774</p>
+ </item>
+ <item>
+ <p> Update <c>orddict</c> to use parameterized types and
+ specs. (Thanks to UENISHI Kota.) </p>
+ <p>
+ Own Id: OTP-12785</p>
+ </item>
+ <item>
+ <p>The assert macros in <c>eunit</c> has been moved out
+ to <c>stdlib/include/assert.hrl</c>. This files get
+ included by <c>eunit.hrl</c>. Thus, nothing changes for
+ eunit users, but the asserts can now also be included
+ separately.</p>
+ <p>
+ Own Id: OTP-12808</p>
+ </item>
+ </list>
+ </section>
+
+</section>
+
<section><title>STDLIB 2.4</title>
<section><title>Fixed Bugs and Malfunctions</title>
@@ -476,8 +1013,7 @@
also implemented by the generic behaviours
<c>gen_server</c>, <c>gen_event</c> and <c>gen_fsm</c>.</p>
<p>
- The potential incompatibility refers to</p>
- <p>
+ The potential incompatibility refers to:</p>
<list> <item>The previous behaviour of intercepting the
system message and passing a tuple of size 2 as the last
argument to <c>sys:handle_system_msg/6</c> is no longer
@@ -485,7 +1021,7 @@
<c>StateFun</c> in <c>sys:replace_state/2,3</c> fails is
changed from being totally silent to possibly (if the
callback module does not catch) throw an exception in the
- client process.</item> </list></p>
+ client process.</item> </list>
<p>
(Thanks to James Fish and Steve Vinoski)</p>
<p>
@@ -647,22 +1183,28 @@
<p>
EEP43: New data type - Maps</p>
<p>
- With Maps you may for instance: <taglist> <item><c>M0 =
- #{ a =&gt; 1, b =&gt; 2}, % create
- associations</c></item> <item><c>M1 = M0#{ a := 10 }, %
- update values</c></item> <item><c>M2 = M1#{ "hi" =&gt;
- "hello"}, % add new associations</c></item> <item><c>#{
- "hi" := V1, a := V2, b := V3} = M2. % match keys with
- values</c></item> </taglist></p>
+ With Maps you may for instance:</p>
+ <taglist>
+ <tag/> <item><c>M0 = #{ a =&gt; 1, b =&gt; 2}, % create
+ associations</c></item>
+ <tag/><item><c>M1 = M0#{ a := 10 }, % update values</c></item>
+ <tag/><item><c>M2 = M1#{ "hi" =&gt;
+ "hello"}, % add new associations</c></item>
+ <tag/><item><c>#{ "hi" := V1, a := V2, b := V3} = M2.
+ % match keys with values</c></item>
+ </taglist>
<p>
For information on how to use Maps please see Map Expressions in the
<seealso marker="doc/reference_manual:expressions#map_expressions">
Reference Manual</seealso>.</p>
<p>
The current implementation is without the following
- features: <taglist> <item>No variable keys</item>
- <item>No single value access</item> <item>No map
- comprehensions</item> </taglist></p>
+ features:</p>
+ <taglist>
+ <tag/><item>No variable keys</item>
+ <tag/><item>No single value access</item>
+ <tag/><item>No map comprehensions</item>
+ </taglist>
<p>
Note that Maps is <em>experimental</em> during OTP 17.0.</p>
<p>
@@ -1413,13 +1955,15 @@
supervisor or for the problematic child.</p>
<p>
This introduces some incompatibilities in stdlib due to
- new return values from supervisor: <list>
+ new return values from supervisor:</p>
+ <list>
<item>restart_child/2 can now return
{error,restarting}</item> <item>delete_child/2 can now
return {error,restarting}</item> <item>which_children/1
returns a list of {Id,Child,Type,Mods}, where Child, in
addition to the old pid() or 'undefined', now also can be
- 'restarting'.</item> </list></p>
+ 'restarting'.</item>
+ </list>
<p>
*** POTENTIAL INCOMPATIBILITY ***</p>
<p>
@@ -1435,10 +1979,10 @@
Own Id: OTP-9782 Aux Id: seq11964 </p>
</item>
<item>
- <p> Use universal time as base in error logger
+ <p> Use universal time as base in error logger</p>
<p>
Previous conversion used the deprecated
- calendar:local_time_to_universal_time/1 </p></p>
+ calendar:local_time_to_universal_time/1 </p>
<p>
Own Id: OTP-9854</p>
</item>
@@ -2195,10 +2739,10 @@
Own Id: OTP-8989 Aux Id: seq11741 </p>
</item>
<item>
- <p>Fix exception generation in the io module
+ <p>Fix exception generation in the io module</p>
<p>
Some functions did not generate correct badarg exception
- on a badarg exception.</p></p>
+ on a badarg exception.</p>
<p>
Own Id: OTP-9045</p>
</item>