This document describes the release notes for older versions of the
stdlib
application.Stdlib 1.8.1
Improvements and new features
lists:sort/2
is stable again.
Own Id: OTP-3344- The command-completion feature of the shell has been improved. Pressing the tab key now also lists possible completions (but only if no new character was added to the completion).
Own Id: OTP-3354Stdlib 1.8
Known problems
- If Erlang is started with longnames (e.g.,
erl -name foo
), thenslave:start/1
on a nonexistent host exits instead of returning an error tuple.
Own Id: OTP-2635- Excessively large variable numbers in the matching functions in the
ets
module can crash Erlang or block it for a long time, e.g.,ets:match(Table, '$123456789')
.
Own Id: OTP-3064- The shell allows patterns which do not have pattern syntax (for example function calls); they become patterns which always fail to match.
Own Id: OTP-3284Fixed errors and malfunctions
- When
c:c(File, Options)
was used with options such that an intermediate file was produced instead of an object file (e.g., 'S'), it still tried to load an object file (which would be the old one, if one existed).
This has been changed. A warning message will be printed (Warning: No object file created - nothing loaded
) and no object file will be loaded even if an (older) object file exists.
Own Id: OTP-3056
Aux Id: OTP-3054- Erlang shell line editing (e.g., M-B to back up over a word) didn't handle all Latin-1 characters correctly.
Own Id: OTP-3158ets:tab2list/1
returned the list in the wrong order for a table of typeordered_set
.
Own Id: OTP-3319Improvements and new features
- The new lint option
{warn_format, Verbosity}
causes warnings to be given for malformed calls toio:format
and some similar functions.Verbosity
is an integer which determines the amount of warnings to give (0 = no warnings).
Own Id: OTP-1387- Dets now has a write through caching mechanism as well as an auto save feature. Dets more seldom needs to repair files.
Own Id: OTP-1831
Aux Id: OTP-1526- Many functions in stdlib do not enforce the types which the functions are documented to accept, thus resulting in undefined behaviour when given arguments of invalid type. Stricter error checking has been added to some functions in stdlib, namely
io:get_chars
,lists:keymember/3
,lists:keysearch/3
,lists:keydelete/3
andlists:keyreplace/4
, resulting in an exit if an invalid argument is given.
(*** POTENTIAL INCOMPATIBILITY ***)
Own Id: OTP-2689
Aux Id: OTP-2441- New functions
lists:sort(Fun, List)
andlists:merge(Fun, List1, List2)
can be used for sorting/merging with respect to any criterion;Fun(A,B)
should return whetherA
comes beforeB
in the ordering.
Own Id: OTP-2948- A new function
c:bt(Pid)
, available in the shell without module prefix, shows a stack backtrace for a process (i.e., callserlang:process_display(Pid, backtrace)
).
Own Id: OTP-3122- The new function
c:q()
(also defined in the moduleshell_default
so that the module prefix need not be given in the shell) callsinit:stop
, and thus provides a short command to stop Erlang in a controlled way.
Own Id: OTP-3123- The functions
behaviour_info/[0,1]
have been removed from the modulesystools
.
(*** POTENTIAL INCOMPATIBILITY ***)
Own Id: OTP-3159
Aux Id: OTP-1965- The function
c:i()
now gives two lines of information for each process, including: heap size, stack size, registered name.
Own Id: OTP-3160- The output functions in the
io
module no longer return an error term in case of errors; they exit instead.
(*** POTENTIAL INCOMPATIBILITY ***)
Own Id: OTP-3178- The new lint option
warn_unused_vars
causes warnings to be given for variables which are not used (unless they begin with an underscore, in which case no warning is given).
Own Id: OTP-3181- Parenthesis-matching in the shell has been improved. A new command key ^] performs visible parenthesis blink, like the closing characters (i.e., ')', '}' or ']'), but it also inserts the proper matching character. The closing characters now beep if the matching opening character isn't of the right kind.
Own Id: OTP-3250- Enable the supervisor to handle other replies than {ok, Pid} when starting children.
Own Id: OTP-3251- The erl_internal:builtins/0 function has been removed.
(*** POTENTIAL INCOMPATIBILITY ***)
Own Id: OTP-3300- Due to an oversight, the following improvement was left out of the documentation in previous releases: The operator
--
performs list subtraction. It is also available as the functionlists:subtract/2
.
Own Id: OTP-3318- The following functions in the
lists
module now have a faster implementation compared to previous releases:map/2
,last/1
,keysearch/3
,keymember/3
and all sorting functions. The functionsmember/2
,reverse/2
,keysearch/3
andkeymember/3
are now entirely implemented as BIFs.
Own Id: OTP-3334- Ets tables on remote nodes can no longer be accessed directly. Also, the format of the table identifiers returned by
ets:open/2
have changed. Incorrectly written applications that assume that the table identifier is a tuple will no longer work.
Most functions in theets
module are now BIFs. The internal and undocumented BIFs that theets
module used to call have been removed. Applications that incorrectly used the those BIFs directly will no longer work.
(*** POTENTIAL INCOMPATIBILITY ***)
Own Id: OTP-3337Stdlib 1.7
Fixed errors and malfunctions
- Erlang shell line editing (e.g., M-B to back up over a word) didn't handle all Latin-1 characters correctly.
Own Id: OTP-3158Stdlib 1.6.1
Improvements and new features
- When a module with behaviour
gen_server
,gen_event
orgen_fsm
was compiled, warnings were given for absent call-back functions, except forcode_change
. Now, a warning is given for absentcode_change
as well.
Own Id: OTP-3148
Aux Id: OTP-3072, OTP-3026Stdlib 1.6
Fixed errors and malfunctions
- The previously undocumented function
queue:to_list/1
didn't work properly. Now, it returns the elements of the queue, the oldest first in the list.
Own Id: OTP-2701
Aux Id: Seq 1069- A tab in the Erlang shell (modulename completion) could block a big system (>1000 modules) for several seconds and consumed a huge amount of memory. The reason for this was that
append
was used to create the list of all modules and this is very inefficient. This has now been corrected: 1)code:all_loaded
no longer uses append. 2)append
and all other BIFs can no longer consume unlimited amounts of memory before a garbage collection occurs.
Own Id: OTP-2708erl_parse:abstract/1
crashed when given terms such as[4|5]
.
Own Id: OTP-2836- The module
erl_id_trans
didn't handle unary operators before numeric literals, or the Mnemosynequery
expression.
Own Id: OTP-2838- C-nodes previously could get an rpc:call trying to execute process_info on the C-node. C-nodes are so called "hidden" nodes and should not get any rpc calls by accident. This is now corrected.
Own Id: OTP-2953erl_scan:string/[1,2]
handled comments incorrectly.
Own Id: OTP-2986ets:match_object/2
is made faster by removing areceive after 1
and letting the internal BIF db_match_object decide if the current process should be rescheduled.
Own Id: OTP-2987
Aux Id: Seq 1500- ets:match_delete now works correctly for the duplicate_bag ets table type.
Own Id: OTP-3005
Aux Id: Seq 1512- The handling of the freelist in
dets
is made more efficient. In the previous version of dets thedets:close/1
could take several hours in the worst case because of computation which tried to combine the freelist. This is now corrected and the new version has significantly better performance in dets:open_file and dets:close while having the same or marginally worse performance on dets:delete. The time it takes to open or close a dets file is now always short (at the seconds level at worst , in the most cases much faster).
Own Id: OTP-3025erl_pp:form/[1,2]
now format upper-case record names correctly; previously the necessary quoting was left out. This affected for example the toolscover
andcoast
.
Own Id: OTP-3058, OTP-2952
Aux Id: OTP-2952- If the argument to the attribute
-include_lib
didn't contain a '/', the compilation/preprocessing crashed, instead of giving a proper error message.
Own Id: OTP-3073erl_lint:is_guard_test/1
did not accept floating-point literals. This caused execution usingerl_eval
(for example in the shell) to behave incorrectly when floating-point literals occurred in guards.
Own Id: OTP-3091Improvements and new features
- The erl_tar:table/2 function now returns more information about each member in the tar file if given the
verbose
option. Tww new functions, erl_tar:t/1 and erl_tar:tt/2, prints the members of the tar file instead of returning them. Thett/1
function simply prints the name of each member (like 'tar t'), whilett/2
prints more information similar to 'tar tv'.
Own Id: OTP-2520- For consistency,
lists:seq(N,N,0)
now returns[N]
instead of giving an error.
(*** POTENTIAL INCOMPATIBILITY ***)
Own Id: OTP-2613- The syntax of Erlang tokens has been extended to allow the use of the full ISO-8859-1 (Latin-1) character set. This is noticeable in the following ways: all the Latin-1 printable characters can be used and are shown without the escape backslash convention; atoms and variables can use all Latin-1 letters.
Own Id: OTP-2985- The result of
c:m(Module)
contains a tuple{time, Time}
which represents the date and time of compilation of the module. Previously, the time was in the local timezone of the compilation. Since there is no record of what that timezone was, the time information was unreliable, and has been changed to always be in GMT (if the underlying system supports it - in other words, whaterlang:universaltime/0
returns).
(*** POTENTIAL INCOMPATIBILITY ***)
Own Id: OTP-3012- The
export_all
compilation option no longer produces one warning for each function defined in a module; it produces one single warning (sinceexport_all
shouldn't be used in production code).
Own Id: OTP-3020- When compiling, warnings for functions which are not used are now given also for functions which call only themselves.
Own Id: OTP-3021
Aux Id: OTP-1007- Due to an oversight, the following improvement was left out of the documentation in previous releases:
The variables used in the matching functions in the
ets
module are not restricted to '$0' to '$9' anymore.
Own Id: OTP-3063- The
gen_server:call
now uses the new BIFmonitor/2
which makes it possible to monitor the death of processes. This makes the call safer and the feedback to the caller will be immediate if the serving process has died or dies when it services the call. Previously the only way to prevent a hanging here was to use theTimeout
argument to the call function. A potential incompability is that thegen_server:call
and comparable functions in thegen_event
andgen_fsm
modules now can exit with another reason thantimeout
when the server has terminated its execution. The new reason isnoproc
.
(*** POTENTIAL INCOMPATIBILITY ***)
Own Id: OTP-3074- A note on forward compatibility. Users are urged to refrain from using the following constructions: 1) numeric ASCII codes for characters; 2) strings spanning several lines; 3) the character constant "
$
" to produce a space. These constructions are still legal, but will produce warnings in future releases, and at some point may be removed from the language. Instead, use: 1) character constant syntax; 2) the escape code "\n"; 3) the character constant "$\s".
Own Id: OTP-3083Stdlib 1.5.2
Fixed errors and malfunctions
ets:file2tab
which usesdisk_log
now uses theread_only
option todisk_log:open
when it opens the file.
Own Id: OTP-1716
Aux Id: OTP-1765- On Unix, if the name of the current directory contained a blank,
os:cmd/1
would fail. This has been corrected.
Own Id: OTP-2026- It was possible for ets:all/1 to include malformed table identifiers in the result. This has been fixed.
Own Id: OTP-2214- The compiler previously silently accepted that a module defined a function with the same name and arity as an imported function. This now causes an error.
Own Id: OTP-2338
Aux Id: seq 793- erl_scan:string/1 used to exit in many situations where it should return an error tuple. This has been fixed.
Own Id: OTP-2347- When given a bad first argument, io:format/3, io:fwrite/3 and io:fread/3 could hang instead of returning an error. This has been fixed.
Own Id: OTP-2400- lists:seq/3 hanged instead of exiting for some invalid arguments; e.g., lists:seq(1, 5, -1). This has been fixed.
Own Id: OTP-2404- Guard expressions could cause exit when used in shell and erl_eval, instead of causing the guard to fail. This has been fixed.
Own Id: OTP-2405- missing parameter, Id, in application_controller:do_change_appl/3 fixed.
Own Id: OTP-2681
Aux Id: seq 1029- The low level process interface 'proc_lib' used by itself and also by generic servers has a syncronisation bug. The scenario is
1. Process A calls proc_lib:spawn() returning the process id B of the child. The function will wait for an answer from the child.
2. The function times out waiting for an answer from the child using proc_lib:init_ack().
3. Process A tries again calling proc_lib:spawn() returning process id C. But now the child B has answered and because the wait function doesn't check where the answer comes from it believes that it was process C that was succeeding.
Own Id: OTP-2702
Aux Id: seq1051Improvements and new features
- erl_lint now gives warnings for some useless constructions which are usually the result of misspellings, e.g., "7(X)", or "s#state{nr=1}".
Own Id: OTP-1927
Aux Id: OTP-1961Stdlib 1.5.1
Fixed errors and malfunctions
- keysort/2 is now stable (i.e., it preserves the order of elements which have the same key). Bad arguments now cause an exit, instead of just silently returning the input list.
(*** POTENTIAL INCOMPATIBILITY ***)
Own Id: OTP-2300- A call to dets:open_file/1 resulting in an error could cause both the caller and the dets server to hang. This has been fixed.
Own Id: OTP-2399- The documentation for erl_parse:parse_term/1 incorrectly stated that it returns the abstract form of a term, so that parse_term/1 and tokens/1 are the inverses of each other. Actually, erl_parse:parse_term/1 returns the term itself. The documentation has been changed to reflect this.
Own Id: OTP-2401Improvements and new features
- Many functions in stdlib do not enforce the types which the functions are documented to accept, thus resulting in undefined behaviour when given arguments of invalid type. Stricter error checking has been added to some functions in stdlib, namely lists:sublist/[2,3] and lists:keysort/2, resulting in an exit if an invalid argument is given.
(*** POTENTIAL INCOMPATIBILITY ***)
Own Id: OTP-2441
Aux Id: OTP-2300, OTP-2689- ets:i/0 used to truncate entries which didn't fit in the designated field. Now, nothing is truncated - the remaining entries are pushed to the right instead.
Own Id: OTP-2524R3B02 (Stdlib 1.4.2)
Fixed errors and malfunctions
dets
can now repair files even if parts of the segment array is truncated. The problem occured whenmnesia
was used.
Own Id: OTP-2056
Aux Id: seq 559, OTP-2042- The compiler (on jam systems) did report "error head-mismatch" on the wrong line (the last instead of the first head-mismatch). This is corrected.
Own Id: OTP-2125
Aux Id: seq 616- A
dets
internal problem withsplit_to_binary
which caused mnesia user problems is fixed.
Own Id: OTP-2156
Aux Id: seq 636- If the system was halted when
dets
is in the middle of repairing a small file (i.e a file that is repaired in RAM), this could result in a corruptdets
file. This is now corrected. The version of thedets
file format is stepped to 8 and version 6 and 7 files are automatically upgraded when they are opened.
Own Id: OTP-2221
Aux Id: seq 672- In previous R3 releases,
slave:start/X
didn't work iferl
was started with long names (-name Name
).
Own Id: OTP-2288
Aux Id: seq 746dets
is now put under control of a supervisor when it is started. This corrects the earlier problem that causeddets
to be terminated when mnesia was terminated even though there could be other users ofdets
.
Own Id: OTP-2296
Aux Id: seq 754ets:new/2
could case the whole emulator to crash if called with a not well formed list as second argument. Example:ets:new(a,[set|protected])
which should result in{'EXIT',{badarg,Reason}}
and not make the emulator to crash. This is corrected.
Own Id: OTP-2314
Aux Id: seq 769- A
dets
file must be closed by the owner (i.e the process that opened it).{error, not_owner}
will be returned if another process tries to close the file.
Own Id: OTP-2393R3B (Stdlib 1.4.1)
Fixed errors and malfunctions
- If the evaluator exits while the shell is reading a new prompt, the exit message will be printed immediately.
Own Id: OTP-2085
Aux Id: seq 592R3A (Stdlib 1.4)
Fixed errors and malfunctions
- In dets tables of type bag an object could sometimes be duplicated by mistake. This is corrected.
Own Id: OTP-1642- The ets:info/2 BIF used to fail with badarg if the table didn't exist, contrary to the documentation which states that undefined should be returned. The implementation has been corrected. This might break existing code that evaluated ets:info/2 within a catch and assumed that an nonexisting table was indicated by an 'EXIT' tuple.
(*** POTENTIAL INCOMPATIBILITY ***)
Own Id: OTP-1868
Aux Id: seq 418- The function sys:log_to_file didn't close old files, this is corrected.
Own Id: OTP-1977Improvements and new features
- The function nativename/1 has been added to the filename module. It converts a filename to a form acceptable for command shell and native applications on the currently running platform. Specifically, on Windows it replaces slashes with backslashes.
Own Id: OTP-1632- Enhancements in dets: Support for etimated_no_objects. Dets now uses ram_files pread and pwrite which results in significantly improved performance for certain operations.
Own Id: OTP-1641- The documentation regarding terminate and trap_exits is improved for the gen_* modules.
Own Id: OTP-1755- The following functions are added to the module calendar: now_to_local_time/1, now_to_universal_time/1 (== now_to_datetime/1), local_time_to_universal_time/1, universal_time_to_local_time/1.
Own Id: OTP-1801- New table option 'duplicate_bags' added to both ets and dets. A 'duplicate_bag' table can have several identical objects.
Own Id: OTP-18101 Stdlib 1.3.2
1.1 Incompatibilities with Stdlib 1.3.1
- Because of the major updates to the
slave
module a version of OTP with this new slave module as described here *cannot* start slave nodes on computers using an older version of OTP, and vice versa.
The return values fromslave
on error are changed (atoms are used instead of strings).
Own Id:OTP-1463
1.2 Fixed Bugs and malfunctions
filename:basename("/foo/bar/")
returned wrong result:[]
. The last/
should be ignored and the result should be"bar"
.
Own Id:OTP-1451
1.3 Improvements and new features
slave:start
is enhanced to work on other platforms (e.g WIN32). Previously it was UNIX specific.
Own Id:OTP-1463
- The
timer
module is modified to be a gen_server and is now supervised by the safe kernel supervisor.
Own Id: OTP-1469
2 Stdlib 1.3.1
2.1 Fixed Bugs and malfunctions
ets
tables created before the system was converted to a distributed system could not be accessed then the system became distributed. The representation of theets
table identifier is thus changed.
Own Id: OTP-1393
3 Stdlib 1.3
3.1 Improvements and new features
erl_eval
did crash on valid input like:
1> lists:sort(A=[1,2]).A correction conserning variable bindings is done.
Own Id: OTP-1295
dets:next
did sometimes erreounously return'$end_of_table'
.
Own Id: OTP-1293
- Corrected spelling errors in
help()
printout from shell.
Own Id: OTP-1038
- Added a new function
sync_notify
ingen_event
.
Own Id: OTP-1310
- The functions
add_sup_handler/3
andswap_sup_handler/3
are added to thegen_event
module. They are used to supervisegen_event
handlers.
Own Id: OTP-1122
- It is possible to add several handlers using the same call-back module to a
gen_event
event manager. Use the new{Module, Id}
syntax for such event handlers.
gen_event
generates an error report when a handler crashes.
- Two new supervisor types
rest_for_one
andsimple_one_for_one
are added.
Own Id: OTP-1177
os:type/1
and its documentation is corrected.
Own Id: OTP-1185
- The function
init_ack/1
is added to theproc_lib
module.
erl_lint
produces warnings related to thebehaviour
module attribute. For example, missing call-back functions are reported. This feature is used by the compiler.
Own Id: OTP-1200
3.2 Fixed Bugs and malfunctions
gen_server:cast
andgen_server:abcast
did sometimes crash if the server did not exist.
Own Id:OTP-1343
- The
ets
reference manual is corrected to describe what happens when trying to access a non existant table.
Own Id:OTP-1244
3.3 Incompatibilities with Stdlib 1.2
4 Stdlib 1.2
4.1 Improvements and new features
- The
dets
module has been greatly enhanced. Previously thedets
module had no real space management on the file. Now, space is managed on a per file basis by a builtin buddy system. This means that allocation is much faster. The format of a dets file is consequently also changed, the dets module will however recognize files with the old format and automatically upgrade the file to the new format the first time it is opened.
This has consequences for the Mnesia system, or rather it does not, since the version upgrade is done automatically.
- A new module
filename
which has a number of useful functions for manipulation of filenames. These functions are recommended to use when writing applications which shall be runnable on a number of different platforms.
- A new module
os
which provides functions which enables various information from the host operating system to the Erlang programmer. The functioncmd/1
is equivalent with theunix:cmd/1
on a unix platform and will also be available on other platforms if applicable, e.g on Windows NT. This function is the recommended way of issuing operating system commands from Erlang programs (rather thanunix:cmd/1
). Other functions in the module areversion
andtype>
which give information about the host operating system version and type.
4.2 Fixed Bugs and malfunctions
- The
ets
man page updated (Name instead of Id).
Own Id: OTP-1001.
- The
ets
module now handles arbitrarily many variables. Previously there was an upper limit of 10.
Own Id: OTP-1124.
5 Stdlib 1.1
5.1 Improvements and new features
- Added
disk_log
, a disc based term logging facility.
- Added
dets
, a disc based term storage.
- Added
proc_lib:start/3,4
,proc_lib:start_link/3,4
andproc_lib:init_ack/2
for synchronous start ofproc_lib
processes.
- Added
regexp
, regular expression functions for strings.
- It is possible to have anonymous supervisors.
5.2 Fixed Bugs and malfunctions
- Fixed bug in
timer
there timeouts would cause an internal error under heavy load.
5.3 Incompatibilities with OTP P1G
- It is possible to change the internal state of the event manager using the
gen_event:call
function. Thehandle_call/2
call-back function should return in a similar way as thehandle_event/2
function.
- A
gen_event
worker should specifydynamic
for modules in the supervisor child specification.
5.4 Known bugs and problems
-