io:format("~p\n", [[X]=[a]])
',
the result of the match expression '[X]=[a]
' should
be '[a]
', but in Beam it was 'a
'.
This all means that multiple patterns in function bodies
such as '[X] = [Y] = [a]
' would fail with a badmatch exception
in Beam releases before R6.
This has been corrected in the new Beam compiler.
Incorrect code like 'a = [X] = [a]
' which depended
on the incorrect behaviour will now fail with a badmatch.
erl_interface
, a function erl_mk_long_ref
has been added, and macros ERL_REF_NUMBERS
and
ERL_REF_LEN
.
process_info(Pid, stack_size)
used to always return 0. Now, it instead returns the
actually used size of the stack.
process_info(Pid, backtrace)
returned just a binary,
not a tuple {backtrace, Pid}
, as the documentation
indicates.
erlang:fun_info/2
which can be used
to take funs apart and erlang:fun_to_list/1
which returns
a textual representation of a fun.
Funs have their own external representaion
when they are sent to other nodes. If a fun is sent to an
old R5 node, it will automatically be converted to the old tuple
form. Funs in the old tuple form received from other nodes will
be recognized as funs in this version of OTP (R6), but not
in R7.
The check_process_code/2
BIF will now return
true
if the process contains funs that depend on the
old code of the module.
Own Id: OTP-3364
The generated code for the C-client back-end from this version of IC (3.8), can only be used for communication with node running new runtime systems (erts-4.9 and later) because of the new external format for the Erlang reference datatype.
Due to optimizations in the Java backend, the stub initialization and usage differs from the previous version.
spawn(Fun)
, spawn(Node, Fun)
,
and corresponding spawn_link
, replacing previous
undocumented BIFs with the same names.
The trace/3 BIF is now longer auto-imported; it must be called as erlang:trace/3 or imported.
The 'bifs' flag is no longer supported. Bifs can be traced
as any exported function using the new call tracing
(see erlang:trace_pattern/2
).
The 'suspend' flag is no longer supported. Use the new
erlang:suspend_process/1
and erlang:resume_process/1
Bifs instead.
The 'call' flag turns on new call tracing for a process. Use the 'old_call_trace' to turn on the old-fashioned call tracing.
There is no longer a restriction that process cannot trace a process that is tracing another processs. Therefore, it is possible to construct a circle of processes that are tracing each other (which is a bad idea beacuase the Erlang machine will probably crasch).
The trace messages from send and receive traces have been changed to make consistent with the other trace messages. Now all trace messages have the pid of the traced process in position 2 and the type of trace in position 3.
If timestamps are enabled, the first element of each trace message tuple will be 'trace_ts'.
The return value is no longer 'true', but the number of processes
that matched the process argument. For instance, the return value
will be '1' if an explicit Pid argument was given.
Own Id: OTP-3237
Aux Id: OTP-3238
There are two new Bifs similar to exit/1, except that
they generate information about which in function the fault
occurred. The Bifs are erlang:fault/1
and
erlang:fault/2
.
Own Id: OTP-3239
disk_log
module has been changed according to the
following. Requests to close a disk log are always granted.
The disk log is unblocked if the blocking process closes
the disk log. Any other process just closes the log. If a
process that is linked to a disk log terminates, this
is handled exactly as if the process had closed the log
and then terminated. If any other process than the blocking
one tries to unblock a log,
{error, {not_blocked_by_pid, Name}}
is returned.
The exit messages returned by open and reopen have been
changed.
disk_log
module has been slightly changed
according to the following.
inc_wrap_file/1
sends wrap notices.
inc_wrap_file/1
and change_size/2
return
an error message if anything goes wrong, rather than
terminating the log. block/1,2
, sync/1
and
truncate
no longer queue requests if the log is
blocked with QueueLogRecords
set to false
.
Files other than internal logs and shorter than 8 bytes are
not overwritten when opening an internal log. If the process
that has blocked a log tries to update the log, an error
message is returned.
It should be sufficient to restart one
In mnesia-3.7.2 the following recovery mechansim where introduced.
Mnesia generated a core dump and intentionally stopped if the log files were corrupted and contained the wrong records. Now Mnesia will generate an error event and continue if possible. This behaviour may lead to inconsistent data but Mnesia will be alive.
The statement above is only valid if configuration parameter
behaviour_info/[0,1]
have been
removed from the module systools
.
io:get_chars
,
lists:keymember/3
,
lists:keysearch/3
,
lists:keydelete/3
and
lists:keyreplace/4
,
resulting in an exit if an invalid argument is given.
behaviour_info/[0,1]
have been
removed from the module systools
.
io
module
no longer return an error term in case of
errors; they exit instead.
ets:open/2
have changed. Incorrectly written applications
that assume that the table identifier is a tuple will no
longer work.
ets
module are now BIFs. The internal
and undocumented BIFs that the ets
module used to call
have been removed. Applications that incorrectly used the those
BIFs directly will no longer work.