You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: book/modules/creating_modules.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -40,11 +40,11 @@ use inc.nu *
40
40
# => 6
41
41
```
42
42
43
-
Of course, you can easily distribute this file so that others can make use of the module as well.
43
+
Of course, you can easily distribute a file like this so that others can make use of the module as well.
44
44
45
45
## Exports
46
46
47
-
We covered the types of definitions that are available in modules briefly in [Using Modules](./using_modules.md) from the end-user's perspective. Module authors, on the other hand, need to know _how_ to create the export definitions for:
47
+
We covered the types of definitions that are available in modules briefly in the main Modules Overview above. While this might be enough explanation for an end-user, module authors will need to know _how_ to create the export definitions for:
Only definitions marked with `export` (or `export-env` for environment variables) are accessible when the module is imported. Definitions not marked with `export` are only visible from inside the module. In some languages, these would be called "private" definitions. An example can be found below in [Additional Examples](#local-definitions).
58
+
Only definitions marked with `export` (or `export-env` for environment variables) are accessible when the module is imported. Definitions not marked with `export` are only visible from inside the module. In some languages, these would be called "private" or "local" definitions. An example can be found below in [Additional Examples](#local-definitions).
59
59
:::
60
60
61
61
### `main` Exports
@@ -64,7 +64,7 @@ Only definitions marked with `export` (or `export-env` for environment variables
64
64
An export cannot have the same name as that of the module itself.
65
65
:::
66
66
67
-
In the [Basic Example](#basic-module-example) above, we had a module named `inc` with a command named `increment`. However, if you try to renamed that file to `increment.nu`, it will fail to import.
67
+
In the [Basic Example](#basic-module-example) above, we had a module named `inc` with a command named `increment`. However, if we rename that file to `increment.nu`, it will fail to import.
68
68
69
69
```nu
70
70
mv inc.nu increment.nu
@@ -85,7 +85,7 @@ export def main []: int -> int {
0 commit comments