Age | Commit message (Collapse) | Author |
|
* hasse/stdlib/pP_with_no_line_breaks/OTP-15103/ERL-607:
kernel: Use ~0p
debugger: Use ~0p
common_test: Use ~0p
stdlib: Make pP insert no line breaks with field width zero
|
|
|
|
See also https://bugs.erlang.org/browse/ERL-634.
The utility program `erl_call' in erl_interface used to call
lib:eval_str/1, which is no longer present in Erlang/OTP 21.0.
The lib module was eliminated in OTP-15072, see also
https://github.com/erlang/otp/pull/1786.
|
|
See also https://bugs.erlang.org/browse/ERL-607.
A zero field width used to insert line breaks "everywhere", but with
this patch no line breaks are inserted.
|
|
|
|
* dgud/stdlib/string-case-bin-bug:
Fix *case bugs for binaries
|
|
* hasse/dialyzer/improve_contract_warnings/OTP-14982:
erts: Improve contracts of zlib
kernel: Improve contracts
erts: Improve a contract
stdlib: Improve a contract
compiler: Improve a contract
dialyzer: Refine the test for overspecified functions
|
|
Bad optimizing code introduced in 5c51e87bee9d
|
|
* lukas/stdlib/fix-io_o_request_raise/OTP-15101:
stdlib: Fix io:put_chars/2 error
|
|
Before this fix an error in io:put_chars/2 would signal
a fault in io:put_chars/3 because of the way that raise is
used and there is no such function.
|
|
|
|
* ingela/gen-fsm-deprecation:
gen_fsm: should be deprecated eventually
|
|
These are replaced by new config handling and must not be used any
more.
|
|
|
|
* origin/ingela/ssl/deprecate-ssl-accept/OTP-15056:
ssl: Deprecate ssl:ssl_accept/[1,2,3]
|
|
|
|
* sverker/ets-delete_all_objects-trap/OTP-15078:
erts: Rename untrapping db_free_*empty*_table
erts: Make ets:delete_all_objects yield on fixed table
erts: Optimize ets delete all in fixed table
erts: Refactor ets select iteration code
erts: Cleanup ets code
erts: Optimize ets hash object deallocactions
erts: Refactor pseudo deleted ets objects
erts: Make atomic ets:delete_all_objects yield
erts: Fix reduction bump for ets:delete/1
|
|
Add ?OTP_RELEASE, -if and -elif to the preprocessor
OTP-15087
|
|
OTP-14988
|
|
* richcarl/eliminate_lib_module/PR-1786/OTP-15072:
Fix minor issues
Eliminate call to ct:get_progname() in ts_erl_config
Use \n escape instead of integer 10
Move error formatting to erl_error.erl and delete lib.erl
Move extended parse functions in lib.erl to erl_eval.erl
Move lib:eval_str/1 into mod_esi.erl
Remove lib:progname/0
Eliminate call to lib:progname/1 in slave.erl
Add ct:get_progname/0
Remove lib:error_message/2
Remove lib:flush_receive/0
Remove lib:send/2 and lib:sendw/2
Move lib:nonl/1 into yecc.erl
|
|
|
|
|
|
Libraries or applications that support more than one major
release of OTP may need to use conditional compilation of
Erlang source code. Here are few examples where it would be
necessary or desirable:
* To support a new data type or language feature only available
in the latest major release (real-world examples: maps and the
stacktrace syntax).
* To avoid warnings for deprecated functions.
* To avoid dialyzer warnings.
Previously, to do conditional compilation, one would have to
use a parse transform or some external tool such as 'autoconf'.
To simplify conditional compilation, introduce the -if and -elif
preprocessor directives, to allow code like this to be written:
-if(?OTP_RELEASE =:= 21).
%% Code that will only work in OTP 21.
-else.
%% Fallback code.
-endif.
What kind of expressions should be allowed after an -if?
We certainly don't want to allow anything with a side effect,
such as a '!' or a 'receive'. We also don't want it to be
possible to call erlang:system_info/1, as that could make the
code depedent on features of the run-time system that could
change very easily (such as the number of schedulers).
Requiring the expression to be a guard expression makes most
sense. It is to explain in the documentation and easy for users
to understand. For simplicity of implementation, only a single
guard expression will be supported; that is, the ',' and ';' syntax
for guards is not supported.
To allow some useful conditions to be written, there is a special
built-in function:
defined(Symbol) tests whether the preprocessor symbol is defined,
just like -ifdef. The reason for having this defined/1 is that
the defined test can be combined with other tests, for example:
'defined(SOME_NAME) andalso ?OTP_RELEASE > 21'.
|
|
by using a cooperative strategy that will make
any process accessing the table execute delelete_all_objects_continue
until the table is empty.
This is not an optimal solution as concurrent threads will still
block on the table lock, but at least thread progress is made.
|
|
Update global name typespec
|
|
Introduce is_map_key/2 guard BIF
OTP-15037
|
|
Add a new pre-defined macro called OTP_RELEASE that will expand
to an integer being the OTP version. Thus, in OTP 19 the value will
be the integer 19.
The OTP_RELEASE macro is particularly useful in order to have
different source code depending on new language features or new
features in the type specification syntax. Those features are only
introduced in major versions of OTP.
To be truly useful, the -if preprocessor directive need to be
implemented. That is the purpose of the next commit.
Code that will need to work in both OTP 18 and OTP 19 can be
structured in the following way:
-ifdef(OTP_RELEASE).
%% Code that only works in OTP 19 and later.
-else.
%% Code that will work in OTP 18.
-endif.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
This complements the `map_get/2` guard BIF introduced in #1784.
Rationale.
`map_get/2` allows accessing map fields in guards, but it might be
problematic in more complex guard expressions, for example:
foo(X) when map_get(a, X) =:= 1 or is_list(X) -> ...
The `is_list/1` part of the guard could never succeed since the
`map_get/2` guard would fail the whole guard expression. In this
situation, this could be solved by using `;` instead of `or` to separate
the guards, but it is not possible in every case.
To solve this situation, this PR proposes a `is_map_key/2` guard that
allows to check if a map has key inside a guard before trying to access
that key. When combined with `is_map/1` this allows to construct a
purely boolean guard expression testing a value of a key in a map.
Implementation.
Given the use case motivating the introduction of this function, the PR
contains compiler optimisations that produce optimial code for the
following guard expression:
foo(X) when is_map(X) and is_map_key(a, X) and map_get(a, X) =:= 1 -> ok;
foo(_) -> error.
Given all three tests share the failure label, the `is_map_key/2` and
`is_map/2` tests are optimised away.
As with `map_get/2` the `is_map_key/2` BIF is allowed in match specs.
|
|
|
|
* siri/kernel/logger/OTP-13295:
Add documentation of the built-in logger handlers
Catch badarg in logger:get_format_depth/0
Add chars_limit option to logger_formatter
Don't kill logger process until all other processes are dead
Set call timeout for logger_server to infinity
Update primary bootstrap
Test cuddle for logger
Update cth_log_redirect to a logger handler
Start using logger internally in kernel and stdlib
Remove error_logger process and add logger process
Add logger
|
|
* hasse/stdlib/rfc3339_datetime/OTP-14764:
stdlib: Add RFC 3339 functions to module calendar
|
|
|
|
Allow installing multiple instances of sys debug function
This commit solves a bug which allowed installing {Fun,State} as sys debug function even if Fun was already installed. This happened in the case when the current State of the debug fun was undefined.
Also, the new format {Id,Fun,State} of debug functions can be installed, allowing multiple instances of the same fun.
|
|
[stdlib/sys.erl] Fix sys module's debug statistics not including the out message count when using gen_server:call/2.
OTP-15047
|
|
Functions for converting between RFC 3339 strings and system time
are added.
Options are lists, but we are considering using maps instead. If we
change, it will happen after Erlang/OTP 21.0-rc1 is released.
|
|
* hasse/stdlib/calendar_systemtime/OTP-13413:
stdlib: Add system time functions to module calendar
|
|
|
|
Use the same depth for all (printed) elements of a map.
Since the order of keys can vary when printing a map--maps:iterator/1
and maps:next/1 are used--it is more consistent to print all
associations with the same depth.
If the associations printed are limited by the depth, the selection
of associations is arbitrary, as before.
|
|
Inspiration from module lager_format.
Also some improvements of Unicode handling.
io_lib:format/3 and io_lib:fwrite/3 are new functions. The
representation of the options is a list, but we are considering using
a map instead. If we change, it will happen after Erlang/OTP 21.0-rc1
is released.
|
|
A bug fix: limited maps end with "...", not "...=>...".
A modification: wW separate pairs with " => ", not "=>".
When the output is limited on number of characters, the term is
balanced by wW the same way as is done with pP (see commit bc38638).
|
|
|