Skip to content

Commit b2d913f

Browse files
authored
Reorder require mention in import section (#1685)
1 parent 86b983f commit b2d913f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

getting-started/alias-require-and-import.markdown

+2-2
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ Note that like the `alias` directive, `require` is also lexically scoped. We wil
9090

9191
## import
9292

93-
We use `import` whenever we want to access functions or macros from other modules without using the fully-qualified name. Note we can only import public functions, as private functions are never accessible externally.
93+
We use `import` whenever we want to access functions or macros from other modules without using the fully-qualified name. Note we can only import public functions, as private functions are never accessible externally. `import`ing a module automatically `require`s it.
9494

9595
For example, if we want to use the `duplicate/2` function from the `List` module several times, we can import it:
9696

@@ -114,7 +114,7 @@ defmodule Math do
114114
end
115115
```
116116

117-
In the example above, the imported `List.duplicate/2` is only visible within that specific function. `duplicate/2` won't be available in any other function in that module (or any other module for that matter). `import`ing a module automatically `require`s it.
117+
In the example above, the imported `List.duplicate/2` is only visible within that specific function. `duplicate/2` won't be available in any other function in that module (or any other module for that matter).
118118

119119
Note that `import`s are generally discouraged in the language. When working on your own code, prefer `alias` to `import`.
120120

0 commit comments

Comments
 (0)