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: docs/user-guide/04-modules-and-access-control.md
+6-6
Original file line number
Diff line number
Diff line change
@@ -191,14 +191,14 @@ The Slang compiler enforces the following rules regarding access control:
191
191
- Type definitions themselves cannot be `private`, for example, `private struct S {}` is not valid code.
192
192
-`interface` requirements cannot be `private`.
193
193
194
-
## Organizing Systems of Modules
194
+
## Organizing File Structure of Modules
195
195
196
196
Slang does not seek to impose any specific organization of modules. However, there are some conventions that have emerged as being useful.
197
197
198
198
### Module Organization Suggestions
199
199
200
-
-Top-level modules are those that are`import`ed by user code.
201
-
- The implementation details of the module are placed in the lower levels of the tree.
200
+
-The top-level directory contains modules that would be`import`ed by user code.
201
+
- The implementation details of the modules are placed in files at lower levels of the tree.
202
202
203
203
This has the benefit that it is easy for a user to distinguish the public API from the implementation details.
204
204
@@ -210,9 +210,9 @@ This has the benefit that it is easy for a user to distinguish the public API fr
210
210
211
211
The above diagram shows a module organization example.
212
212
213
-
Top-level modules such as `utils.slang` are those that are directly `import`ed by user code. The implementation details of the module are placed in the lower levels of the tree.
213
+
Top-level module files such as `utils.slang` are those that are directly `import`ed by user code. The implementation details of the module are placed in the lower levels of the tree, organized into similarly named subdirectories for clarity.
214
214
215
-
In this example, the `utils.slang`module needn't contain anything more than a module declaration and a list of included sub-modules, with optional `import` statement(s) to pull in any external dependencies, e.g.
215
+
Modules like `utils.slang` needn't contain anything more than a module declaration and a list of included files, with optional `import` statement(s) to pull in any external dependencies, e.g.
Here, all the symbols defined in `accumlator.slang`, `tonemap.slang`, and `fill.slang` are visible to the user of the `utils` module, and these helper modules do not need to clutter the top-level file hierarchy.
226
+
Here, all the public symbols defined in `accumlator.slang`, `tonemap.slang`, and `fill.slang` are visible to the user of the `utils` module, and these constituent helper files do not need to clutter the top-level file hierarchy.
0 commit comments