Age | Commit message (Collapse) | Author |
|
* rickard/time-unit/OTP-13831:
Replace usage of deprecated time units
|
|
* maint:
parsetools: Correct handling of Unicode in Leex
Don't report error for shutdown exit tuple
|
|
'legoscia/dynamic-child-shutdown-tuple/ERL-163/PR-1158/OTP-13907' into maint
* legoscia/dynamic-child-shutdown-tuple/ERL-163/PR-1158/OTP-13907:
Don't report error for shutdown exit tuple
|
|
* maint:
stdlib: Add a testcase for Unicode expander
Support for unicode expander
|
|
* andrey/stdlib/fix_edlin_expand/ERL-1152:
stdlib: Add a testcase for Unicode expander
Support for unicode expander
|
|
|
|
|
|
|
|
OTP-13633
|
|
When a simple_one_for_one supervisor is shutting down, and a child
exits with an exit reason of the form {shutdown, Term}, handle it as
if the exit reason were 'shutdown', without printing an error report.
This makes the behaviour of wait_dynamic_children match that of
do_restart.
This fixes ERL-163.
|
|
|
|
* bjorn/floor-ceiling/OTP-13692:
Add math:floor/1 and math:ceil/1
Implement the new ceil/1 and floor/1 guard BIFs
|
|
Add math:floor/1 and math:ceil/1 to avoid unnecessary conversions
in floating point expressions. That is, instead of having to write
float(floor(X)) as part of a floating point expressions, we can
write simply math:floor(X).
|
|
Implement as ceil/1 and floor/1 as new guard BIFs (essentially part of
Erlang language). They are guard BIFs because trunc/1 is a guard
BIF. It would be strange to have trunc/1 as a part of the language, but
not ceil/1 and floor/1.
|
|
The filters in a list comprehension can be guard expressions or
an ordinary expressions.
If a guard expression is used as a filter, an exception will basically
mean the same as 'false':
t() ->
L = [{some_tag,42},an_atom],
[X || X <- L, element(1, X) =:= some_tag]
%% Returns [{some_tag,42}]
On the other hand, if an ordinary expression is used as a filter, there
will be an exception:
my_element(N, T) -> element(N, T).
t() ->
L = [{some_tag,42},an_atom],
[X || X <- L, my_element(1, X) =:= some_tag]
%% Causes a 'badarg' exception when element(1, an_atom) is evaluated
It has been allowed for several releases to override a BIF with
a local function. Thus, if we define a function called element/2,
it will be called instead of the BIF element/2 within the module.
We must use the "erlang:" prefix to call the BIF.
Therefore, the following code is expected to work the same way as in
our second example above:
-compile({no_auto_import,[element/2]}).
element(N, T) ->
erlang:element(N, T).
t() ->
L = [{some_tag,42},an_atom],
[X || X <- L, element(1, X) =:= some_tag].
%% Causes a 'badarg' exception when element(1, an_atom) is evaluated
But the compiler refuses to compile the code with the following
diagnostic:
call to local/imported function element/2 is illegal in guard
|
|
The compiler would crash in v3_codegen when trying to compile the
following code:
is_port(_) -> false.
foo(P) when port(P) -> ok.
We *could* have the compiler interpret the code as:
is_port(_) -> false.
foo(P) when erlang:is_port(P) -> ok.
But that would encourage using the obsolete form of the guard tests.
Note that the following code is illegal:
is_port(_) -> false.
foo(P) when is_port(P) -> ok.
It produces the following diagnostic:
call to local/imported function is_port/1 is illegal in guard
Therefore, we should refuse to compile the code.
|
|
The previous commits have made sys_pre_expand superfluous. Since
sys_pre_expand is undocumented and unsupported it can be removed in
a major release without prior deprecation.
Also remove code in erl_parse that handles abstract code that has
passed through sys_pre_expand.
We considered deprecating sys_pre_expand just in case, but decided
against it for the following reasons:
- Anyone brave and knowledgeable enough to use sys_pre_expand should
be able to cope with sys_pre_expand being removed.
- If we kept it, but didn't test it anywhere in OTP, it could
potentially stop working. So we would probably have to add some test
cases.
|
|
erl_expand_records now adds "erlang:" to calls to BIFs, so we
can simplify the code.
|
|
As the next step in eliminating sys_pre_expand, teach
erl_expand_records to handle calls without explicit module name. If
such call refer to a BIF or imported function, add an explicit module
name.
That means that any subsequent pass will know that a call without
a module name is always to a local function defined in the module.
|
|
The sys_pre_expand module used to do a lot more (translate records and
funs, for example), but now it does very little. Most of the code is
an identify transformation of the abstract format.
The identity transformation part of the code must be maintained and
kept correct when new forms are added to the abstract format. That
adds to the maintance burden. It also adds (slightly) to compilation
times. Therefore, we want to eliminate sys_pre_expand, moving all of
its (non-identity) transformations to better places.
As a preliminary first step, move the code that adds the pre-defined
functions (such as module_info/0) to a new function in erl_internal.
|
|
* maint:
beam_lib: Correct type for the abstract code chunk
|
|
The abstract_code chunk can also contain {eof,_}, {error,_}, and
{warning,_} in addition to the abstract forms that make up the Erlang
syntax proper.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
* josevalim/large-binary-strings/PR-1131/OTP-13794:
Move expansion of strings in binaries to v3_core
|
|
|
|
This speeds up the compilation of binary literals
with string values in them. For example, compiling
a file with a ~340kB binary would yield the following
times by the compiler:
Compiling "foo"
parse_module : 0.130 s 5327.6 kB
transform_module : 0.000 s 5327.6 kB
lint_module : 0.011 s 5327.8 kB
expand_module : 0.508 s 71881.2 kB
v3_core : 0.463 s 11.5 kB
Notice the increase in memory and processing time
in expand_module and v3_core. This happened because
expand_module would expand the string in binaries
into chars. For example, the binary <<"foo">>, which
is represented as
{bin, 1, [
{bin_element, 1, {string, 1, "foo"}, default, default}
]}
would be converted to
{bin, 1, [
{bin_element, 1, {char, 1, $f}, default, default},
{bin_element, 1, {char, 1, $o}, default, default},
{bin_element, 1, {char, 1, $o}, default, default}
]}
However, v3_core would then traverse all of those
characters and convert it into an actual binary, as it
is a literal value.
This patch addresses this issue by moving the expansion
of string into chars to v3_core and only if a literal
value cannot not be built. This reduces the compilation
time of the file mentioned above to the values below:
Compiling "bar"
parse_module : 0.134 s 5327.6 kB
transform_module : 0.000 s 5327.6 kB
lint_module : 0.005 s 5327.8 kB
expand_module : 0.000 s 5328.7 kB
v3_core : 0.013 s 11.2 kB
|
|
|
|
|
|
'raimo/stdlib/gen_statem-types-and-templates/ERL-172_ERL-187/OTP-13746' into maint
* raimo/stdlib/gen_statem-types-and-templates/ERL-172_ERL-187/OTP-13746:
Fix type and template errors from bugs.erlang.org: ERL-172 and ERL-187
|
|
|
|
Conflicts:
OTP_VERSION
|
|
|
|
* maint:
Fix return value spec for ets:match_object
|
|
ets:match_object/1 and ets:match_object/3 return list of matches
|
|
See also ERL-182.
|
|
* bjorn/remove-gs/OTP-13703:
Remove the gs application
|
|
The gs application ws deprecated in R15B01.
|
|
Guard tests (e.g. is_list/1) are listed both in guard_bif/2 and
in new_type_test/2. That is a trap for anyone who wants to add
a new guard test. Let guard_bif/2 call new_type_test/2 so that
new guard tests only have to be added in one place.
While we are it, also sort the clauses in guard_bif/2 and
new_type/2.
|
|
|
|
* bjorn/stdlib/deprecate-queue-lait/OTP-13658:
Deprecate queue:lait/1
|
|
|
|
* hasse/dialyzer/improve_from_form/OTP-13547:
Update primary bootstrap
stdlib: Correct types and specs
dialyzer: Minor adjustments
dialyzer: Suppress unmatched_return for send/2
dialyzer: Improve the translation of forms to types
dialyzer: Use a cache when translating forms to types
dialyzer: Prepare erl_types:t_from_form() for a cache
dialyzer: Optimize erl_types:t_form_form()
dialyzer: Correct types
syntax_tools: Correct types
erts: Correct character repr in doc of the abstract format
stdlib: Correct types and specs
|
|
It is possible that '...' is added later (OTP 20.0), but for now we
are not sure of all details.
|
|
|
|
|