Skip to content

Commit

Permalink
clarify module exports
Browse files Browse the repository at this point in the history
  • Loading branch information
kaikalii committed Nov 18, 2024
1 parent 4f66a9f commit 925b5d3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions site/src/tutorial.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1562,6 +1562,10 @@ fn TutorialModules() -> impl IntoView {
<Editor example="┌─╴Mod\n A ← 5\n F ← +1\n G ← F F\n└─╴\nG A"/> // Should fail
<p>"Names from inside the module can be "<em>"made"</em>" visible by following the module name with a "<code>"~"</code>" and a list of the names to make visible."</p>
<Editor example="┌─╴Mod ~ A G\n A ← 5\n F ← +1\n G ← F F\n└─╴\nG A"/>
<p>"Note that these names are brought into the module's parent scope as private bindings, so they cannot be referenced from outside the parent."</p>
<Editor example="┌─╴Mod\n ┌─╴SubMod ~ X\n X ← 5\n └─╴\n└─╴\nMod~X"/> // Should fail
<p>"Names must be re-bound in the parent to be made visible."</p>
<Editor example="┌─╴Mod\n ┌─╴SubMod\n X ← 5\n └─╴\n X ← SubMod~X\n└─╴\nMod~X"/>
<p>"Names defined above the module can be referenced inside it."</p>
<Editor example="B ← 5\n┌─╴Mod\n C ← ×2 B\n└─╴\nMod~C"/>

Expand Down

0 comments on commit 925b5d3

Please sign in to comment.