Skip to content

Commit aa45edc

Browse files
committed
Mention Record.import in defrecord documentation
1 parent 2c36d8f commit aa45edc

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

lib/elixir/lib/kernel.ex

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1474,6 +1474,15 @@ defmodule Kernel do
14741474
14751475
When defining a type, all the fields not mentioned in the type are
14761476
assumed to have type `term`.
1477+
1478+
## Importing records
1479+
1480+
It is also possible to import a public record (a record, defined using
1481+
`defrecord`) as a set of private macros (as if it was defined using `defrecordp`):
1482+
1483+
Record.import Config, as: :config
1484+
1485+
See `Record.import/2` documentation for more information
14771486
"""
14781487
defmacro defrecord(name, fields, opts // [], do_block // []) do
14791488
Record.defrecord(name, fields, Keyword.merge(opts, do_block))

0 commit comments

Comments
 (0)