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: pages/docs/manual/latest/let-binding.mdx
+8-8Lines changed: 8 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -150,8 +150,8 @@ If you need _real_ mutation, e.g. passing a value around, have it modified by ma
150
150
151
151
Private let bindings are introduced in the release [7.2](https://rescript-lang.org/blog/bucklescript-release-7-2).
152
152
153
-
In the module system, everything is public by default,
154
-
the only way to hide some values is by providing a separate signature to
153
+
In the module system, everything is public by default,
154
+
the only way to hide some values is by providing a separate signature to
155
155
list public fields and their types:
156
156
157
157
```res
@@ -162,7 +162,7 @@ module A: {
162
162
let b = 4
163
163
}
164
164
```
165
-
`%private` gives you an option to mark private fields directly
165
+
`%%private` gives you an option to mark private fields directly
166
166
167
167
```res
168
168
module A = {
@@ -171,15 +171,15 @@ module A = {
171
171
}
172
172
```
173
173
174
-
`%private` also applies to file level modules, so in some cases,
174
+
`%%private` also applies to file level modules, so in some cases,
175
175
users do not need to provide a separate interface file just to hide some particular values.
176
176
177
-
Note interface files are still recommended as a general best practice since they give you better
178
-
separate compilation units and also they're better for documentation.
177
+
Note interface files are still recommended as a general best practice since they give you better
178
+
separate compilation units and also they're better for documentation.
179
179
180
-
Still, `%private` is useful in the following scenarios:
180
+
Still, `%%private` is useful in the following scenarios:
181
181
182
182
- Code generators. Some code generators want to hide some values but it is sometimes very hard or time consuming for code generators to synthesize the types for public fields.
183
183
184
-
- Quick prototyping. During prototyping, we still want to hide some values, but the interface file is not stable yet, `%private` provide you such convenience.
184
+
- Quick prototyping. During prototyping, we still want to hide some values, but the interface file is not stable yet, `%%private` provide you such convenience.
0 commit comments