There were instances of IO.puts/1 calls without parens throughout the
whole codebase (in docs, code, tests). I removed most of them where it
made sense to do so, so that users will find documentation and other
things consistent with how the formatter behaves.
Binary/bitstring matching allows to dynamically define the
`size` of the binary in certain conditions:
* if the `size` variable is defined prior to the pattern
match:
iex> size = 8
iex> <<a::size(size), rest::binary>> = "hello"
iex> a
104
* if the `size` variable is matched within the same
binary/bitstring match, prior to its use:
iex> <<name_size::size(8), name::binary-size(name_size), _rest::binary>> = <<5, "Frank the Walrus">>
iex> name
"Frank"
Other cases are considered illegal patterns, for example:
{name_size, <<name::binary-size(name_size), _rest::binary>>} = {5, "Frank the Walrus"}
This commit raises a `CompileError: undefined variable ...` for such cases.
1. avoid use of single-char variables with not descriptive names ("i")
2. "value" can be thought of a number, so to make it clearer I replace it with "name"
* 4_294_967_295 is still a valid number
* it is not correct to say that :infinity is the same as not using a timeout value,
as this is needed if used the after clause. To what's equivalent is as to not to
use the after clause itself.
* use the formal name "hexadecimal notation" in favor of "hex notation"
[ci skip]
Erlang/OTP 20 warns if the stacktrace is read outside of a
catch/rescue. This commit mirrors this behaviour by consistently
warning on `System.stacktrace/0` being used outside of a
catch/rescue.
Erlang/OTP 21 warns whenever System.stacktrace/:erlang.get_stacktrace
are used. Therefore we need to promote the usage of `__STACKTRACE__`
and make sure to conditionally compile it according to the OTP version.
This requires changes to the Exception normalization mechanism
so we compute `__STACKTRACE__` only when strictly required.
In future Elixir releases, `System.stacktrace/0` will warn when
used even inside catch/rescue.