## 1 STDLIB Release Notes

This document describes the changes made to the STDLIB application.

### 1.1 STDLIB 1.14

#### 1.1.1 Fixed Bugs and Malfunctions

- A bugfix in QLC: two of the call-back functions used for implementing QLC tables, `TraverseFun` and `LookupFun`, are now allowed to return a term other than a list. Such a term is immediately returned as the results of the current query, and is useful mostly for returning error tuples.
  Several other minor bugs have been also been fixed.
  Own Id: OTP-5195
- The STDLIB modules `error_logger_file_h` and `error_logger_tty_h` now read the environment variable `utc_log` from the SASL application.
  Own Id: OTP-5535
- `ets:info/1` has been corrected to behave according to the documentation and return a list of tuples, not a tuple with tuples.
  *** POTENTIAL INCOMPATIBILITY ***
  Own Id: OTP-5639
- Referencing a so far undeclared record from the default value of some record declaration is from now on considered an error by the linter. It is also an error if the default value of a record declaration uses or binds a variable.
  *** POTENTIAL INCOMPATIBILITY ***
  Own Id: OTP-5878
- When a file `.hrl` file is included using `-include_lib`, the include path is temporarily updated to include the directory the `.hrl` file was found in, which will allow that `.hrl` file to itself include files from the same directory as itself using `-include`. (Thanks to Richard Carlsson.)
  Own Id: OTP-5944
- Corrected `filelib:ensure_dir/1` which sometimes returned `true` and sometimes `ok` to always return `ok` when successful. This goes against the documentation which said `true`, but `ok` was judged to be a more logical return value.
  *** POTENTIAL INCOMPATIBILITY ***
  Own Id: OTP-5960 Aux Id: seq10240
- The shell now handles records better when used in calls on the form `{Module, Function}(ArgList)`.
  Own Id: OTP-5990 Aux Id: OTP-5876
- The functions `lists:ukeysort/2` and `lists:ukeymerge/3` have been changed in such a way that two tuples are considered equal if their keys match.
  For the sake of consistency, `lists:usort/2` and `lists:umerge/3` have been modified too: two elements are considered equal if they compare equal.
  The `file_sorter` module has been modified in a similar way: the `unique` option now applies to the key (`keysort()` and `keymerge()`) and the ordering function (the option `{order, Order}` ).
  *** POTENTIAL INCOMPATIBILITY ***
  Own Id: OTP-6019
- Correction in documentation for `ets:update_counter/3`; failure with `badarg` also if the counter to be updated is the key.
  Own Id: OTP-6072
- When sorting terms using the `file_sorter` module and an ordering fun, the sort was not always stable. This bug has been fixed.
  Own Id: OTP-6088

#### 1.1.2 Improvements and New Features

- Improvements of the linter:
  - The `compile` attribute is recognized after function definitions.
  - The new compiler option `nowarn_deprecated_function` can be used for turning off warnings for calls to deprecated functions.
  - The new compiler option `{nowarn_unused_function,[{Name,Arity}]}` turns off warnings for unused local functions for the mentioned functions. The new options `{nowarn_deprecated_function,[{Module,Name,Arity}]}` and `{nowarn_bif_clash,[{Name,Arity}]}` work similarly.
  The Erlang code preprocessor `epp` now recognizes the `file` attribute. This attribute is meant to be used by tools such as Yecc that generate source code files.
  Own Id: OTP-5362
- The formatting option `~s` of `io:fwrite` and `io_lib:fwrite` has been extended to handle arguments that are binaries or I/O lists.
  Own Id: OTP-5403
- The control sequences `p` and `P` of the `Format` argument of the functions `io:format/2,3` and `io_lib:format/2` have been changed as to display the contents of binaries containing printable characters as strings.
  Own Id: OTP-5485
- The linter emits warnings for functions exported more than once in `export` attributes.
  Own Id: OTP-5494
- A manual for STDLIB has been added, `stdlib(6)`. It mentions the configuration parameters for the Erlang shell.
  Own Id: OTP-5530
- Added the `zip` module with functions for reading and creating zip archives. See `zip(3)`.
  Own Id: OTP-5786
- Simple-one-for-one supervisors now store the pids of child processes using `dict` instead of a list. This significantly improves performance when there are many dynamic supervised child processes. (Thanks to Mickaël Rémond et al.)
  Own Id: OTP-5898
- When given the new option '`strict_record_tests`', the compiler will generate code that verifies the record type for '`R#record.field`' operations in guards. Code that verifies record types in bodies has already been generated since R10B, but in this release there will be a '`{badrecord,RecordTag}`' instead of a '`badmatch`' if the record verification test fails. See the documentation for the `compile` module for more information.
  The Erlang shell always applies strict record tests.
  Own Id: OTP-5915 Aux Id: OTP-5714
- The Erlang pretty printer (`erl_pp`) now tries to insert line breaks at appropriate places.
  Own Id: OTP-5924
- The `public` option has been removed from `digraph:new/1`. The reason is that several functions in the `digraph` module are implemented using multiple ETS accesses, which is not thread safe. (Thanks to Ulf Wiger.)
  *** POTENTIAL INCOMPATIBILITY ***
  Own Id: OTP-5985
- The function `lists:keyreplace/4` checks that the fourth argument (`NewTuple`) is a tuple.
  Own Id: OTP-6023
- Added an example of how to reconstruct source code from debug info (abstract code) to `beam_lib(3)`. (Thanks to Mats Cronqvist who wrote the example.)
  Own Id: OTP-6073
- The new compiler option `warn_unused_record` is used for finding unused locally defined record types.
  Own Id: OTP-6105

### 1.2 STDLIB 1.13.12

#### 1.2.1 Fixed Bugs and Malfunctions

- `shell_default:xm/1` has been added. It calls `xref:m/1`.
  Own Id: OTP-5405 Aux Id: OTP-4101
- Warnings are output whenever so far undeclared records are referenced from some default value of a record declaration. In STDLIB 1.14 (R11B) such forward references will cause a compilation error.
  Own Id: OTP-5878
- The linter's check of the `deprecated` attribute did not take the compile option `export_all` into account. This bug has been fixed.
  Own Id: OTP-5917
- The Erlang pretty printer did not handle `try/catch` correctly. This bug has been fixed.
  Own Id: OTP-5926
- Corrected documentation for `lists:nthtail/3`.
  Added documentation for `lists:keymap/3`.
  Tried to clarify some other type declarations and function descriptions in `lists(3)`.
  Corrected documentation for `timer:now_diff/2`.
  Fixed broken links in `gen_fsm(3)`, `gen_server(3)`, `io_lib(3)` and `lib(3)`.
  Own Id: OTP-5931
- Type checks have been added to functions in `lists.erl`.
  Own Id: OTP-5939

#### 1.2.2 Improvements and New Features

- The new STDLIB module `erl_expand_records` expands records in abstract code. It is used by the Erlang shell, which means that Compiler is no longer used by the shell.
  Own Id: OTP-5876 Aux Id: OTP-5435
- The compiler will now warn that the `megaco:format_versions/1` function is deprecated.
  Own Id: OTP-5976

### 1.3 STDLIB 1.13.11

#### 1.3.1 Fixed Bugs and Malfunctions

- When calling `gen_server:enter_loop` with a registered server name, it was only checked that the registered name existed, not that it actually was the name of the calling process.
  Own Id: OTP-5854

#### 1.3.2 Improvements and New Features

- More detail on `beam_lib:version/1` in documentation.
  Own Id: OTP-5789
- The new function `io:read/3` works like `io:read/1,2` but takes a third argument, `StartLine`.
  Own Id: OTP-5813
- The new function `gen_fsm:enter_loop/4,5,6`, similar to `gen_server:enter_loop/3,4,5`, has been added.
  Own Id: OTP-5846 Aux Id: seq10163
- The function `c:i/1` is now exported.
  Own Id: OTP-5848 Aux Id: seq10164

### 1.4 STDLIB 1.13.10

#### 1.4.1 Fixed Bugs and Malfunctions

- A couple of type errors have been fixed in `sofs`.
  Own Id: OTP-5739
- The pre-processor used to complain that the macro definition '`-define(S(S), ??S).`' was circular, which it isn't. (Thanks to Richard Carlsson.)
  Own Id: OTP-5777

### 1.5 STDLIB 1.13.9

#### 1.5.1 Fixed Bugs and Malfunctions

- The linter, QLC and the module `erl_pp` did not handle the new '`fun M:F/A`' construct in all situations. This problem has been fixed.
  Own Id: OTP-5644

#### 1.5.2 Improvements and New Features

- The manual pages for most of the Kernel and some of the STDLIB modules have been updated, in particular regarding type definitions.
  The documentation of the return value for `erts:info/1` has been corrected.
  The documentation for `erlang:statistics/1` now lists all possible arguments.
  Own Id: OTP-5360
- Replaced some tuple funs with the new `fun M:F/A` construct.
  The high-order functions in the lists module no longer accept bad funs under any circumstances. '`lists:map(bad_fun, [])`' used to return '`[]`' but now causes an exception.
  Unused, broken compatibility code in the `ets` module was removed. (Thanks to Dialyzer.)
  Eliminated 5 discrepancies found by Dialyzer in the Appmon application.
  Own Id: OTP-5633
- The `c:i/0` function will now run in a paged mode if there are more than 100 processes in the system. (Thanks to Ulf Wiger.)
  `erlang:system_info(process_count)` has been optimized and does now return exactly the same value as `length(processes())`. Previously `erlang:system_info(process_count)` did not include exiting processes which are included in `length(processes())`.
  The `+P` flag for `erl`, which sets the maximum number of processes allowed to exist at the same, no longer accepts values higher than 134217727. (You will still probably run out of memory before you'll be able to reach that limit.)
  Own Id: OTP-5645 Aux Id: seq9984

### 1.6 STDLIB 1.13.8

#### 1.6.1 Fixed Bugs and Malfunctions

- Very minor corrections in `beam_lib` and its documentation.
  Own Id: OTP-5589

#### 1.6.2 Improvements and New Features

- The `erlang:port_info/1` BIF is now documented. Minor corrections of the documentation for `erlang:port_info/2`.
  Added a note to the documentation of the `math` module that all functions are not available on all platforms.
  Added more information about the '`+c`' option in the `erl` man page in the ERTS documentation.
  Own Id: OTP-5555
- The new `fun M:F/A` construct creates a fun that refers to the latest version of `M:F/A`. This syntax is meant to replace tuple funs `{M,F}` which have many problems.
  The new type test `is_function(Fun,A)` (which may be used in guards) test whether `Fun` is a fun that can be applied with `A` arguments. (Currently, `Fun` can also be a tuple fun.)
  Own Id: OTP-5584

### 1.7 STDLIB 1.13.7

#### 1.7.1 Fixed Bugs and Malfunctions

- `filelib:wildcard/2` was broken (it ignored its second argument).
  Also, `filelib:wildcard("Filename")` (where the argument does not contain any meta-characters) would always return `["Filename"]`. Corrected so that an empty list will be returned if `"Filename"` does not actually exist. (Same correction in `filelib:wildcard/2`.) (This change is a slight incompatibility.)
  `filelib:wildcard/1,2` will generate a different exception when given bad patterns such as `"{a,"`. The exception used to be caused by '`exit(missing_delimiter)`' but is now '`erlang:error({badpattern,missing_delimiter})`'.
  Own Id: OTP-5523 Aux Id: seq9824

#### 1.7.2 Improvements and New Features

- Further improvements of encrypted debug info: New option `encrypt_debug_info` for compiler.
  Own Id: OTP-5541 Aux Id: seq9837

### 1.8 STDLIB 1.13.6

#### 1.8.1 Fixed Bugs and Malfunctions

- When opening a Dets table read only an attempt was sometimes made to re-hash the table resulting in an error message. This problem has been fixed.
  Own Id: OTP-5487 Aux Id: OTP-4989

#### 1.8.2 Improvements and New Features

- It is now possible to encrypt the debug information in Beam files, to help keep the source code secret. See the documentation for `compile` on how to provide the key for encrypting, and the documentation for `beam_lib` on how to provide the key for decryption so that tools such as the Debugger, `xref`, or `cover` can be used.
  The `beam_lib:chunks/2` functions now accepts an additional chunk type `compile_info` to retrieve the compilation information directly as a term. (Thanks to Tobias Lindahl.)
  Own Id: OTP-5460 Aux Id: seq9787

### 1.9 STDLIB 1.13.5

#### 1.9.1 Fixed Bugs and Malfunctions

- Closing a Dets table kept in RAM would cause a crash if the file could not be written. This problem has been fixed by returning an error tuple.
  Own Id: OTP-5402
- `erl_pp` now correctly pretty-prints `fun F/A`.
  Own Id: OTP-5412
- The Erlang shell failed if the compiler was not in the code path. This problem has been fixed, but in order to evaluate records the compiler is still needed.
  Own Id: OTP-5435
- Corrected the example in the documentation for `ets:match/2`. Also clarified that `ets:update_counter/3` updates the counter atomically. (Thanks to Anders Svensson.)
  Own Id: OTP-5452 Aux Id: seq9770, seq9789

#### 1.9.2 Improvements and New Features

- The possibility to start the Erlang shell in parallel with the rest of the system was reintroduced for backwards compatibility in STDLIB 1.13.1. The flag to be used for this is now called `async_shell_start` and has been documented. New shells started from the JCL menu are not syncronized with `init` anymore. This makes it possible to start a new shell (e.g. for debugging purposes) even if the initial shell has not come up.
  Own Id: OTP-5406 Aux Id: OTP-5218
- The compiler will now produce warnings when using the deprecated functions in the `snmp` module.
  Own Id: OTP-5425
- The function `c:zi/0` has been removed. Use `c:i/0` instead.
  Own Id: OTP-5432
- Corrected two minor bugs found by the Dialyzer: Calling a parameterized module from a restricted shell (i.e. if `shell:start_restricted/1` has been used) would crash the shell evaluator. A debug printout in `gen_fsm` had a clause that would never match; causing less information to be printed.
  And a somewhat more serious one also found by Dialyzer: `rpc:yield/1` would crash unless the call started by `rpc:async_call/4` had already finished; `rpc:nb_yield(Key,infinity)` would also crash.
  Cleaned up and removed redundant code found by Dialyzer in `erlang:dmonitor_p/2`.
  Own Id: OTP-5462

### 1.10 STDLIB 1.13.4

#### 1.10.1 Fixed Bugs and Malfunctions

- Bugs in the Erlang shell have been fixed.
  Own Id: OTP-5327
- Some dead code reported by Dialyzer was eliminated.
  A bug in `dbg` when tracing to wrap trace files has been corrected. It failed to delete any already existing wrap trace files with the same names when starting a new wrap trace.
  Own Id: OTP-5329
- The linter could output invalid warnings about bit patterns in record initializations. This problem has been fixed.
  Own Id: OTP-5338
- `ordsets:is_set(NoList)`, where `NoList` is any term except a list, would crash. For consistency with `sets:is_set/1` and `gb_sets:is_set/1`, it now returns `false`.
  Own Id: OTP-5341
- A BIF `erlang:raise/3` has been added. See the manual for details. It is intended for internal system programming only, advanced error handling.
  Own Id: OTP-5376 Aux Id: OTP-5257

#### 1.10.2 Improvements and New Features

- The `deprecated` attribute is now checked by the linter. See `xref(3)` for a description of the `deprecated` attribute.
  Own Id: OTP-5276
- The restricted shell will now indicate if the return value from a user predicate is on an incorrect form.
  Own Id: OTP-5335

### 1.11 STDLIB 1.13.3

#### 1.11.1 Fixed Bugs and Malfunctions

- Bugs concerning unused and shadowed variables have been fixed in the linter.
  Own Id: OTP-5091
- A bug in the evaluator that caused the shell to choke on bit syntax expressions has been fixed.
  Own Id: OTP-5237
- `io:format/2` et.al no longer crashes for some combinations of precision and value for format character "g". Previously it crashed if the precision P was 4 or lower and the absolute value of the float to print was lower than 10^4 but 10^(P-1) or higher. Now it will not crash depending on the value of the float.
  Own Id: OTP-5263
- Bugs in the handling of the bit syntax have been fixed in the Erlang shell.
  Own Id: OTP-5269
- `gb_sets:del_element/2` was changed to do the same as `gb_sets:delete_any/2` which was the original intention, not as `gb_sets:delete/2`. Code that relies on `gb_sets:del_element/2` causing an error if the element does not exist must be changed to call `gb_sets:delete/2` instead.
  The documentation was also updated to explicitly document functions that were only referred to as 'aliases' of a documented function. Also, a list of all functions common to the `gb_sets`, `sets`, and `ordsets` was added.
  *** POTENTIAL INCOMPATIBILITY ***
  Own Id: OTP-5277
- Debug messages have been removed from the QLC module.
  Own Id: OTP-5283

#### 1.11.2 Improvements and New Features

- The size of continuations returned from `dets:match/1,3`, `dets:match_object/1,3`, and `dets:select/1,3` has been reduced. This affects the amount of data Mnesia sends between nodes while evaluating QLC queries.
  Own Id: OTP-5232

### 1.12 STDLIB 1.13.2

#### 1.12.1 Improvements and New Features

- The `-rsh` switch for starting a remote shell (introduced with OTP-5210) clashed with an already existing switch used by `slave`. Therefore the switch for the remote shell is now instead named `-remsh`.
  Own Id: OTP-5248 Aux Id: OTP-5210

### 1.13 STDLIB 1.13.1

#### 1.13.1 Fixed Bugs and Malfunctions

- The Pman 'trace shell' functionality was broken as has now been fixed. Furthermore, Pman could not correctly find the pid of the active shell if more than one shell process was running on the node. This has also been corrected.
  Own Id: OTP-5191
- When the undocumented feature "parameterized modules" was used, the ?MODULE macro did not work correctly.
  Own Id: OTP-5224

#### 1.13.2 Improvements and New Features

- You can now start Erlang with the `-rsh` flag which gives you a remote initial shell instead of a local one. Example:

                  erl -sname this_node -rsh other_node@other_host

  Own Id: OTP-5210
- The man page for the `lists` module has been updated with decscription of the new `zip`, `unzip`, and `partition/2` functions.
  Own Id: OTP-5213
- The top level group leader used to be listed as job #1 in the job list in JCL mode. Since there is no shell associated with this process that can be connected to, it will no longer be listed.
  Own Id: OTP-5214
- The possibility to start the Erlang shell in parallel with the rest of the system has been reintroduced for backwards compatibility. Note that this old behaviour is error prone and should not be used unless for some reason necessary.
  Own Id: OTP-5218 Aux Id: seq9534
- The `shell` commands `rr/1,2,3` now accepts wildcards when reading record definitions from BEAM files.
  Own Id: OTP-5226

Copyright © 1991-2006 Ericsson AB