## 1 Stdlib Release Notes

This document describes the changes made to the Stdlib application.

### 1.1 Stdlib 1.13.8

#### 1.1.1 Fixed Bugs and Malfunctions

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

#### 1.1.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.2 Stdlib 1.13.7

#### 1.2.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.2.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.3 Stdlib 1.13.6

#### 1.3.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.3.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.4 Stdlib 1.13.5

#### 1.4.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.4.2 Improvements and New Features

- The possibility to start the erlang shell in parallell 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 hasn't 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.5 Stdlib 1.13.4

#### 1.5.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 '<c>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.5.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.6 Stdlib 1.13.3

#### 1.6.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 referered to as 'aliases' of a documented function. Also, a list of all functions common to the `gb_sets`, `sets`, and `ordsets` was added.
  Own Id: OTP-5277
- Debug messages have been removed from the QLC module.
  Own Id: OTP-5283

#### 1.6.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.7 Stdlib 1.13.2

#### 1.7.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.8 Stdlib 1.13.1

#### 1.8.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.8.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 parallell 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

### 1.9 Stdlib 1.13

#### 1.9.1 Fixed Bugs and Malfunctions

- gen_server:s internal function get_parent, called by gen_server:enter_loop/[4,5], now returns the pid of parents that are registered processes, instead of returning their name. The reason for this is that gen_server relies on that the parent is represented as a pid. This error in get_parent/0 had the effect that the terminate function of the child was not run when it was shutdown.
  Own Id: OTP-4820 Aux Id: seq8170
- For the bit syntax, when matching with a size field that is bound during the same matching, a warning for unused variable was emitted. This bug has been fixed.
  Own Id: OTP-4858
- When parsing a badly formed file `epp` hangs. This problem has been fixed.
  Own Id: OTP-4871 Aux Id: OTP-4870
- Bugs concerning guards have been fixed in the Erlang interpreter.
  Own Id: OTP-4885
- The linter now checks the record name when calling the function `erlang:is_record/2`.
  Own Id: OTP-4886
- Guards of mach specifications are corrected to resemble the semantics of guards in real code more closely. The implementation now corresponds to the documentation in erts users guide. The following things are corrected:
  - Guard sematics was wrong when it came to logical operators and exceptions. {'or', {'is_integer','$1'}, {'or', '$1', '$1'}} evaluated to true with '$1' bound to an integer.
  - Unary + and - was not implemented
  - Calling operators as Bif's was not supported by ets/dbg:fun2ms (erlang:'or'(A,B) etc)
  - Old typetests (like integer(X) instead of is_integer(X)) was not supported by ets/dbg:fun2ms
  - Semicolon (;) in guards was not supported by ets/dbg:fun2ms
  *** POTENTIAL INCOMPATIBILITY ***
  Own Id: OTP-4927
- A bug that could cause a crash has been fixed in the `file_sorter` module. The crash could only occur when sorting or merging to a file and the input function returned `{end_of_input, Value}`.
  Own Id: OTP-5009
- A function clause exit in filelib:fold_files/5 has been fixed.
  Own Id: OTP-5137
- filelib:fold_files/5 has been fixed to not include directories that match the regular expression in the result. In this process, filelib:is_regular/1 has been added to the module. WARNING the behaviour of filelib:fold_files/5 has also been changed so the regexp match is tried not on the full name, but locally in each traversed directory.
  Own Id: OTP-5171 Aux Id: OTP-5128

#### 1.9.2 Improvements and New Features

- The initial shell process started in parallell with the init boot process. This made it possible to pipe commands to the shell that got evaluated before the system had booted properly. Also the shell was normally accessible before .erlang had been evaluated and this caused problems especially related to code loading. This has now been fixed so that the initial shell is not accessible until after the init boot routine has finished and .erlang has been evaluated. Note that the shell starts before any -s arguments are executed.
  Own Id: OTP-4877
- It is now possible to compile files with erlc without getting a lot of (for compilation) unneccessary code loaded and executed (like distribution, inet config, etc). erlc now also calls erl with `-boot start_clean` (so that sasl is not started even if `start_sasl` is default boot script).
  Own Id: OTP-4878
- Dets tables can now be opened or closed in parallel. In particular, if some table is being repaired, other tables can still be opened or closed.
  Own Id: OTP-4908
- The new STDLIB module `qlc` implements a query language with a list comprehension syntax completely embedded in Erlang. There is support for reading data from ETS, Dets, and Mnesia tables as well as for defining other sources of data. For easy testing queries can be stated in the Erlang shell. The `qlc` module aims at replacing Mnemosyne. See `qlc(3)` for details and examples.
  Own Id: OTP-5043
- Some support for records has been added to the Erlang shell. There are commands for reading record definitions from files and for manipulating record definitions in the shell. The record syntax can be used in the shell and return values are printed as records when possible using the records definitions known to the shell. New commands in the shell are `rd/2`, `rf/0,1`, `rl/0,1`, `rp/1`, and `rr/1,2,3`. Existing functions in `user_default.erl` with any of these names need to be renamed. See `shell(3)` for further details.
  *** POTENTIAL INCOMPATIBILITY ***
  Own Id: OTP-5063
- A new function, string:to_integer/1, has been added.
  Own Id: OTP-5081 Aux Id: OTP-5136
- The new function `dets:repair_continuation/2` can be used for restoring an opaque continuation returned by `dets:select/1` or `dets:select/3` if the continuation has passed through the external term format (been sent between nodes or stored on disk).
  Own Id: OTP-5126
- A new function, string:to_float/1, has been added.
  Own Id: OTP-5136 Aux Id: OTP-5081
- Test cases have been added for string.
  Own Id: OTP-5138

### 1.10 Stdlib 1.12.8

#### 1.10.1 Improvements and New Features

- The functions ets:insert_new/2 and dets:insert_new/2 are added. Please consult the manual pages for details.
  Own Id: OTP-5075
- New function: proc_lib:hibernate/3. Processes spawned using proc_lib (also indirectly, such as gen_server process), should use this function instead of the BIF erlang:hibernate/3 directly to ensure that the exception handler for the process continues to work when the process is awaken.
  Own Id: OTP-5077

### 1.11 Stdlib 1.12.6

#### 1.11.1 Fixed Bugs and Malfunctions

- If many files or sockets were open (more than 256), beam_lib operations could fail. Corrected.
  Own Id: OTP-5046 Aux Id: OTP-4997, seq8590

### 1.12 Stdlib 1.12.5

#### 1.12.1 Fixed Bugs and Malfunctions

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

#### 1.12.2 Improvements and New Features

- If a gen_server, gen_event or gen_fsm process exits with {undef,[{M,F,A}|...]}, the error report will now state if the function call failed because the module could not be loaded or because the function was not exported.
  Own Id: OTP-4952 Aux Id: OTP-4925

### 1.13 Stdlib 1.12.4

#### 1.13.1 Fixed Bugs and Malfunctions

- The shell function `c:regs()` did crash if there was a registered port among the registered names. This is now corrected.
  Own Id: OTP-4890
- A bug has been fixed in `Dets`: not all objects were always visible in tables with more than 131072 keys
  Own Id: OTP-4906
- A bug has been fixed in `Dets`: when trying to repair a version 9 table, a `not_a_dets_file` error message was returned unnecessarily often.
  Own Id: OTP-4907

#### 1.13.2 Improvements and New Features

- Starting Erlang with the +Bi flag (to ignore ^C), now also disables the quit ('q') option in the JCL menu.
  Own Id: OTP-4897

### 1.14 Stdlib 1.12.3

#### 1.14.1 Fixed Bugs and Malfunctions

- A bug in erl_scan caused the compiler to hang when end-of-file in a comment was encountered. This is now corrected.
  Own Id: OTP-4787
- The linter now reports errors for unsafe variables when the option `nowarn_unused_vars` is given.
  Own Id: OTP-4831 Aux Id: seq8202
- `gen_server:cast/2` now crashes for invalid arguments.
  `gen_server:abcast/2-3` now crashes for invalid arguments. The behaviour when casting to the name `global` has been corrected. Previously, `gen_server:abcast(global,[node@host])` tried to cast to the globally registered name `node@host`, which is more of a bug than less. Now such a call will cast to the registered name `global` at the node `node@host` as (probably) expected.
  An `rpc:call/5` and `rpc:block_call/5` having a timeout argument has been added.
  `rpc:abcast/2-3` has been improved not to get stuck waiting for connection setup if the remote node is not connected. In this case the send is spawned off to a temporary process.
  Two typos in the docs for module `calendar` has been corrected thanks to Bengt Kleberg.
  *** POTENTIAL INCOMPATIBILITY ***
  Own Id: OTP-4844 Aux Id: seq8226

#### 1.14.2 Improvements and New Features

- The f/1 shell command did not work correctly with restricted shell.
  Own Id: OTP-4818

### 1.15 Stdlib 1.12.2

#### 1.15.1 Fixed Bugs and Malfunctions

- gen_server:s internal function get_parent, called by gen_server:enter_loop/[4,5], now returns the pid of parents that are registered processes, instead of returning their name. The reason for this is that gen_server relies on that the parent is represented as a pid. This error in get_parent/0 had the effect that the terminate function of the child was not run when it was shutdown.
  Own Id: OTP-4820 Aux Id: seq8170

### 1.16 Stdlib 1.12.1

#### 1.16.1 Fixed Bugs and Malfunctions

- The code server could hang if invoked early in the startup. For example if the emulator was started with "-s file eval Filename" and Filename contained a call to code:add_patha/1 the code server accidentally tried to execute code in an unloaded module from inside the code that loaded a module - hence hangup. This bug has now been fixed.
  Note! Starting erlang through code loading from a remote erlang boot server will not work after this patch. It will be fixed in a later patch. Rumours has it that remote boot server code loading did not work before this patch either. It is not a commonly used feature.
  *** POTENTIAL INCOMPATIBILITY ***
  Own Id: OTP-4802 Aux Id: seq8314

Copyright © 1991-2005 Ericsson AB