Skip to content

Commit 9994dba

Browse files
author
José Valim
committed
Update CHANGELOG
1 parent 294885b commit 9994dba

File tree

2 files changed

+6
-50
lines changed

2 files changed

+6
-50
lines changed

CHANGELOG.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# v0.12.3-dev
22

33
* Enhancements
4+
* [Kernel] Warnings now are explicitly tagged with "warning:" in messages
45
* [Kernel] Explicit functions inlined by the compiler, including operators. This means that `Kernel.+/2` will now expand to `:erlang.+/2` and so on
56
* [Mix] Do not fail if a Mix dependency relies on an outdated Elixir version
67
* [Process] Add `Process.send/2` and `Process.send_after/3`
@@ -14,10 +15,12 @@
1415
* [Process] Ensure monitoring functions are inlined by the compiler
1516

1617
* Deprecations
18+
* [IEx] The helper `m/0` has been deprecated. The goal is to group all runtime statistic related helpers into a single module
1719
* [Kernel] `binary_to_term/1`, `binary_to_term/2`, `term_to_binary/1` and `term_to_binary/2` are deprecated in favor of their counterparts in the `:erlang` module
1820
* [Kernel] `//` for default arguments is deprecated in favor of `\\`. This is a soft deprecation, no warnings will be emitted for it in this release
19-
* [Kernel] Deprecate `@behavior` in favor of `@behaviour`
20-
* [Record] Deprecate `to_keywords`, `getter` and `list getter` functionalities in `defrecordp`
21+
* [Kernel] Deprecated `@behavior` in favor of `@behaviour`
22+
* [Record] `to_keywords`, `getter` and `list getter` functionalities in `defrecordp` are deprecated
23+
* [Record] `Record.import/2` is deprecated
2124

2225
* Backwards incompatible changes
2326
* [Dict] Implementations of `equal?/2` and `merge/2` in `HashDict` and `ListDict` are no longer polymorphic. To get polymorphism, use the functions in `Dict` instead

lib/elixir/lib/record.ex

Lines changed: 1 addition & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -84,41 +84,9 @@ defmodule Record do
8484
8585
defrecord User, name: "José", age: 25
8686
87-
Notice that, unlike `defrecordp`, `defrecord` expects an
88-
alias as the first argument. This is because `defrecord` is going
89-
to create a module named `User` with all the relevant metadata.
90-
This module can then be imported and we can manipulate the user
91-
as with `defrecordp`:
92-
93-
Record.import User, as: :user
94-
user() #=> User[name: "José", age: 25]
95-
user(age: 26) #=> User[name: "José", age: 26]
96-
97-
Notice that now since the record definition is accessible, Elixir
98-
shows the record nicely formatted, no longer as a simple tuple. We
99-
can get the raw formatting by passing `records: false` to `inspect`:
100-
101-
inspect user(), records: false
102-
{ User, "José", 25 }
103-
104-
Since working with external records is common, Elixir allows
105-
developers to skip importing the record altogether in favor
106-
of a `Module[args]` syntax:
107-
108-
# Skipping a field uses its default value
10987
User[] #=> User[name: "José", age: 25]
11088
User[age: 26] #=> User[name: "José", age: 26]
11189
112-
The macro name is replaced by the module name and the parentheses
113-
are replaced by brackets. When this syntax is used, there is no
114-
need to import the record.
115-
116-
Before we sum up the differences between `defrecord` and
117-
`defrecordp`, there is one last functionality introduced by
118-
`defrecord` that we need to discuss.
119-
120-
## Runtime access
121-
12290
All the functionality discussed above happens at compilation time.
12391
This means that both `user(age: 26)` and `User[age: 26]` are expanded
12492
into a tuple at compile time.
@@ -207,22 +175,7 @@ defmodule Record do
207175
Record.Extractor.retrieve(name, opts)
208176
end
209177

210-
@doc """
211-
Import a public record definition as a set of private macros.
212-
213-
Macros defined as in `Kernel.defrecordp/3`. This is useful when one
214-
desires to manipulate a record via a set of macros instead
215-
of the regular access syntax.
216-
217-
## Example
218-
219-
defmodule Test do
220-
Record.import File.Stat, as: :file_stat
221-
222-
def size(file_stat(size: size)), do: size
223-
end
224-
225-
"""
178+
@doc false
226179
defmacro import(module, as: name) do
227180
IO.write :stderr, "Record.import/2 is deprecated and it will be removed in the following releases\n#{Exception.format_stacktrace}"
228181

0 commit comments

Comments
 (0)