File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -169,15 +169,24 @@ create a record with one million elements.
169169
170170As it can be seen from the next sections, working with native records outside of
171171the defining module needs using fully qualified names of the native records:
172- `#misc:user{}`, ... This quickly may become too cumbersome and verbose. The
173- `-import_record` directive works similar to the `-import` and `-import_type` directives.
172+ `#misc:user{}`, ... This quickly may become too cumbersome and
173+ #verbose. The
174+ `-import_record` directive works similar to the `-import` and `-import_type`
175+ directives.
176+
174177Imported native records can be used by their short names.
175178
176179```erlang
177180-module(example2).
178181-import_record(example1, [user, pair]).
179182```
180183
184+ An `-import_record()` directive can be placed anywhere in the module
185+ (but obviously after `-module()` attribute). That makes it possible to
186+ replace an include of an header file with record definitions with an
187+ `-import_record()` directive without having to move it up to near the
188+ top.
189+
181190### Definitions
182191
183192From now on let’s employ more precise terminology (when needed).
You can’t perform that action at this time.
0 commit comments