Skip to content

Commit 61eb611

Browse files
committed
Update CHANGELOG
1 parent 4a5efd5 commit 61eb611

File tree

2 files changed

+36
-19
lines changed

2 files changed

+36
-19
lines changed

CHANGELOG.md

Lines changed: 32 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -85,14 +85,18 @@ often be hard-to-debug generic "argument errors". With Erlang/OTP 25 and Elixir
8585
more detail is provided for easier debugging. This work is part of [EEP
8686
54](https://www.erlang.org/eeps/eep-0054).
8787

88+
Before:
89+
8890
```elixir
89-
# Before:
9091
int = 1
9192
bin = "foo"
9293
int <> bin
9394
#=> ** (ArgumentError) argument error
95+
```
9496

95-
# Now:
97+
Now:
98+
99+
```elixir
96100
int = 1
97101
bin = "foo"
98102
int <> bin
@@ -123,17 +127,18 @@ Enum.slice(letters, 0..5//2)
123127
#=> ["a", "c", "e"]
124128
```
125129

126-
Another one is `binary_slice/2` in the `Kernel` module:
130+
`binary_slice/2` (and `binary_slice/3` for completeness) has been added to the
131+
`Kernel` module, that works with bytes and also support stepped ranges:
127132

128133
```elixir
129134
binary_slice("Elixir", 1..5//2)
130135
#=> "lx"
131136
```
132137

133-
## Expression-based inspection
138+
## Expression-based inspection and `Inspect` improvements
134139

135-
In Elixir, it's conventional to implement the `Inspect` protocol for structs so
136-
that they're inspected with a syntax resembling this:
140+
In Elixir, it's conventional to implement the `Inspect` protocol for opaque
141+
structs so that they're inspected with a special notation, resembling this:
137142

138143
```elixir
139144
MapSet.new([:apple, :banana])
@@ -151,7 +156,7 @@ and pasting it into an IEx session or similar.
151156
Elixir v1.14 changes the convention for some of the standard-library structs.
152157
The `Inspect` implementation for those structs is now a string with a valid
153158
Elixir expression that recreates the struct itself if evaluated. In the
154-
`Version` example above, this is what we have now:
159+
`MapSet` example above, this is what we have now:
155160

156161
```elixir
157162
fruits = MapSet.new([:apple, :banana])
@@ -160,12 +165,16 @@ MapSet.put(fruits, :pear)
160165
```
161166

162167
The `MapSet.new/1` expression evaluates to exactly the struct that we're
163-
inspecting.
168+
inspecting. This allows us to hide the internals of `MapSet`, while keeping
169+
it as valid Elixir code. This expression-based inspection has been
170+
implemented for `Version.Requirement`, `MapSet`, and `Date.Range`.
164171

165-
This expression-based inspection has been implemented for `Version`,
166-
`Version.Requirement`, `MapSet`, and `Date.Range`. Other data types (such as
167-
`PID`) still use the `#name<...>` convention because generally there is no
168-
Elixir expression that can deterministically recreate the data type.
172+
Finally, we have also improved the `Inspect` protocol for structs so the
173+
fields are inspected in the order they are declared in `defstruct`.
174+
The option `:optional` has also been added when deriving the `Inspect`
175+
protocol, giving developers more control over the struct representation.
176+
See the updated documentation for `Inspect` for a general rundown on
177+
the approaches and options available.
169178

170179
## v1.14.0-dev
171180

@@ -179,22 +188,25 @@ Elixir expression that can deterministically recreate the data type.
179188
#### Elixir
180189

181190
* [Calendar] Support ISO8601 basic format parsing with `DateTime.from_iso8601/2`
191+
* [Code] Add `:normalize_bitstring_modifiers` to `Code.format_string!/2`
182192
* [Code] Emit deprecation and type warnings for invalid options in on `Code.compile_string/2` and `Code.compile_quoted/2`
183193
* [Code] Warn if an outdated lexical tracker is given on eval
184194
* [Code] Add `Code.env_for_eval/1` and `Code.eval_quoted_with_env/3`
185195
* [Code] Improve stacktraces from eval operations on Erlang/OTP 25+
186196
* [Enum] Allow slicing with steps in `Enum.slice/2`
187197
* [Float] Do not show floats in scientific notation if below `1.0e16` and the fractional value is precisely zero
188198
* [Inspect] Improve error reporting when there is a faulty implementation of the `Inspect` protocol
189-
* [Inspect] Allow `:optional` when deriving the Inspect protocol
190-
* [Inspect] Inspect struct fields in the order they are defined
199+
* [Inspect] Allow `:optional` when deriving the Inspect protocol for hiding fields that match their default value
200+
* [Inspect] Inspect struct fields in the order they are declared in `defstruct`
191201
* [Inspect] Use expression-based inspection for `Date.Range`, `MapSet`, and `Version.Requirement`
202+
* [IO] Support `Macro.Env` and keywords as stacktrace definitions in `IO.warn/2`
192203
* [Kernel] Allow any guard expression as the size of a bitstring in a pattern match
193204
* [Kernel] Allow composite types with pins as the map key in a pattern match
194205
* [Kernel] Print escaped version of control chars when they show up as unexpected tokens
195206
* [Kernel] Warn on confusable non-ASCII identifiers
196207
* [Kernel] Add `..` as a nullary operator that returns `0..-1//1`
197-
* [Kernel] Implement Unicode Technical Standard #39 recommendations; in particular, we warn for confusable scripts and restrict identifiers to single-scripts or highly restrictive mixed-scripts
208+
* [Kernel] Implement Unicode Technical Standard #39 recommendations. In particular, we warn for confusable scripts and restrict identifiers to single-scripts or highly restrictive mixed-scripts
209+
* [Kernel] Automatically perform NFC conversion of identifiers
198210
* [Kernel] Add `binary_slice/2` and `binary_slice/3`
199211
* [Keyword] Add `Keyword.from_keys/2` and `Keyword.replace_lazy/3`
200212
* [List] Add `List.keysort/3` with support for a `sorter` function
@@ -219,6 +231,7 @@ Elixir expression that can deterministically recreate the data type.
219231

220232
* [ExUnit] Add `ExUnit.Callbacks.start_link_supervised!/2`
221233
* [ExUnit] Add `ExUnit.run/1` to rerun test modules
234+
* [ExUnit] Colorize summary in yellow with message when all tests are excluded
222235

223236
#### IEx
224237

@@ -231,8 +244,11 @@ Elixir expression that can deterministically recreate the data type.
231244

232245
#### Mix
233246

247+
* [mix compile] Add `--no-optional-deps` to skip optional dependencies to test compilation works without optional dependencies
248+
* [mix deps] `Mix.Dep.Converger` now tells which deps formed a cycle
234249
* [mix do] Support `--app` option to restrict recursive tasks in umbrella projects
235250
* [mix do] Allow using `+` as a task separator instead of comma
251+
* [mix format] Support filename in `mix format -` when reading from stdin
236252
* [mix new] Do not allow projects to be created with application names that conflict with multi-arg Erlang VM switches
237253
* [mix profile] Return the return value of the profiled function
238254
* [mix release] Make BEAM compression opt-in
@@ -243,6 +259,7 @@ Elixir expression that can deterministically recreate the data type.
243259

244260
#### Elixir
245261

262+
* [Calendar] Handle widths with "0" in them in `Calendar.strftime/3`
246263
* [CLI] Improve errors on incorrect `--rpc-eval` usage
247264
* [Code] Do not emit warnings when formatting code
248265
* [Enum] Allow slices to overflow on both starting and ending positions

lib/elixir/lib/io.ex

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -293,12 +293,12 @@ defmodule IO do
293293
* a `__STACKTRACE__`, where all entries in the stacktrace will be
294294
included in the error message
295295
296-
* a `Macro.Env` structure, where a single stacktrace entry from
297-
the compilation environment will be used
296+
* a `Macro.Env` structure (since v1.14.0), where a single stacktrace
297+
entry from the compilation environment will be used
298298
299299
* a keyword list with at least the `:file` option representing
300-
a single stacktrace entry. The `:line`, `:module`, `:function`
301-
options are also supported
300+
a single stacktrace entry (since v1.14.0). The `:line`, `:module`,
301+
`:function` options are also supported
302302
303303
This function also notifies the compiler a warning was printed
304304
(in case --warnings-as-errors was enabled). It returns `:ok`

0 commit comments

Comments
 (0)