# Stdlib Release Notes

## Stdlib 1.10

### Fixed errors and malfunctions

- The shell allowed patterns which did not have pattern syntax (for example function calls); they became patterns which always failed to match. Now they cause an exit instead, similar to unbound variables.
  (Own Id: OTP-3284)

- `dets:all/0` failed if it was called before any other dets calls had been made.
  (Own Id: OTP-3621)
  (Aux Id: Seq 4590)

- In the documentation for `erl_lint` in OTP R6 and R7, the prefix "warn_" for the optional warning options `warn_unused_vars` and `warn_format` was left out.
  (Own Id: OTP-3730)

- Spurious format warnings were given by `erl_lint` for correct calls to `format/1`.
  (Own Id: OTP-3731)

- The hash function used in dict and sets is now erlang:phash/2 rather than the broken erlang:hash/2.
  (*** POTENTIAL INCOMPATIBILITY ***)
  (Own Id: OTP-3802)

- In earlier releases of OTP, the manual entry for `sys:change_code` was incorrect.
  (Own Id: OTP-3806)
  (Aux Id: Seq 5034)

- The functions in the `calendar` module now have better error checking, exiting for type errors. In particular, `is_valid_date/[1,3]` no longer return `true` for any invalid dates.
  (Own Id: OTP-3925)
  (Aux Id: seq5187)

- c:memory/[0,1] could previously fail erroneously with a badmatch. This problem has been solved.
  (Own Id: OTP-4017)

- Bug fix: `intersection/1` in the `sets` and `ordsets` modules no longer accepts the empty list as argument. The reason is that intersection of an empty set is undefined.
  (*** POTENTIAL INCOMPATIBILITY ***)
  (Own Id: OTP-4045)

### Improvements and new features

- It is no longer necessary to set a seed explicitly before using `random:uniform`; now `uniform:seed/0` will be called automatically. In addition, new functions exist for handling random numbers in a functional way.
  (Own Id: OTP-3104)
  (Aux Id: Seq 1681)

- New functions added to `beam_lib`: `cmp/2`, `cmp_dirs/2`, `diff_dirs/2`, `strip/1`, `strip_files/1`, and `strip_release/1`. New chunks names recognized by `beam_lib`: `labeled_exports` and `labeled_locals`.
  (Own Id: OTP-3738)
  (Aux Id: OTP-2686)

- All functions in `beam_lib` module now accept a binary as well as a filename.
  (Own Id: OTP-3760)

- The `dets` module has been partly rewritten. `finsert/2` accepts a list of objects. `info/2` accepts the new item tags `access`, `ram_file` and `auto_save`, and the item tags `memory` and `pid` have been documented. The read cache has been removed and the `cache_size` option is ignored (incompatibility). Many functions have been more efficiently implemented than before, this holds in particular when there are several threads. The repair of Dets tables has been rewritten, and is significantly faster than before. New functions are: `to_ets/2` (adds Dets objects to an Ets table); `foldl/3` and `foldr/3` (iterate over the objects of a Dets table); `from_ets/2` (replaces Dets objects by Ets objects); `select/1,2,3` (select Dets objects using match specifications (see the ERTS User´s Guide for a description of match specifications)); `match/1,3` (match Dets objects in chunks); `select_delete/2` (deletes Dets objects using match specifications); `delete_all_objects/1` (deletes all objects of a Dets table efficiently); `init_table/2` (initiates a Dets table using a function to gather objects); `pid2name/1` (returns the name of the Dets table handled by a pid).
  (*** POTENTIAL INCOMPATIBILITY ***)
  (Own Id: OTP-3786)
  (Aux Id: OTP-3746, OTP-3782, OTP-1831)

- A new API, member/2 has been added to ets and dets. This function makes it possible to check for key prescence in a table without reading out the actual data associated with the key.
  (Own Id: OTP-3804)
  (Aux Id: Seq 5029)

- `lists:merge3/3` is a new function that merges three sorted lists. `lists:merge/1` is a new function that merges a list of sorted lists.
  (Own Id: OTP-3880)

- Hidden nodes and hidden global groups have been introduced. This makes it possible to establish hidden connections between Erlang nodes. See global_group(3), and erl(1).
  (Own Id: OTP-3916)
  (Aux Id: OTP-3963)

- The new module `file_sorter` sorts terms on files.
  (Own Id: OTP-3926)

- The number of commands that are saved in the shell can now be changed from the default number 20. The number of command results can be changed independently. See the documentation for the `shell` module.
  (Own Id: OTP-4035)
  (Aux Id: Seq 7035)

- The new module `sofs` manipulates sets of sets.
  (Own Id: OTP-4039)

- `usort/1`, `umerge/{1,2}`, `umerge3/3`, `ukeysort/2`, `ukeymerge/3`, `usort/2`, and `umerge/3` are new functions in the `lists` module. They work as `sort/1`, `merge/1` and so on, but remove duplicates.
  (Own Id: OTP-4041)

- `dets:is_dets_file/1` is a new function that recognizes Dets tables.
  (Own Id: OTP-4083)
  (Aux Id: Seq7090)

- A modified format of Dets tables has been introduced in order to enhance performance, in particular when there are threads and for tables of type `bag` or `duplicate_bag`. The modified format preserves the time order of object insertions. The new `open_file/2` option `version` sets the version of new tables. Default is the version of the modified format. Opening a table of the hitherto default format does not convert the table unless the option `{repair,force}` is given.
  (Own Id: OTP-4108)

- It is now possible to have the compiler check user-defined behaviours and not only the pre-defined OTP behaviours (gen_server etc.).
  This is done by adding a function `behaviour_info/1` to the behaviour module. `behaviour_info(callbacks)` should return a list of `{FunctionName,Arity}` which defines the callback functions the behaviour uses.
  When a callback module with the attribute `-behaviour(Behaviour)` is compiled, its exported functions will be compared with the list returned by `Behaviour:behaviour_info(callbacks)` and a warning will be issued if any callback function is missing.
  Note that the user must ensure that the module `Behaviour` is present at compile-time and can be found in the current code path.
  (Own Id: OTP-4125)

- Process termination when the process owns ETS tables is made considerably faster.
  (Own Id: OTP-4154)
  (Aux Id: OTP-3547)

- Due to the handling of the ETS name-to-table translations, a ets call when the named table did not exist could take considerable time before throwing "badarg". This is no longer the case.
  (Own Id: OTP-4155)
  (Aux Id: OTP-3547)

- The following new functions are added to the ets modules: ets:select/2 ets:select/3 ets:select/1 ets:match/3 ets:match/1 ets:match_object/3 ets:match_object/1 ets:member/2 ets:delete_all_objects/1 ets:delete_object/2 ets:from_dets/2 ets:to_dets/2 ets:test_ms/2 - See the ETS manual page for details. Furthermore the ets:insert/2 function now also accepts a list of objects to be inserted.
  (Own Id: OTP-4156)
  (Aux Id: OTP-3547)

- Ets:safe_fixtable/2 is made more efficient. Fixation is done without message passing and structures are held internally by the emulator.
  (Own Id: OTP-4157)
  (Aux Id: OTP-3547)

There are also release notes for older versions.