-
-
Notifications
You must be signed in to change notification settings - Fork 248
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Syntax lookup: add ref value assignment documentation #206
Syntax lookup: add ref value assignment documentation #206
Conversation
--- | ||
|
||
This operator is syntactic sugar for assigning to the `contents` value of a `ref` | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actually no sugar provided for ref
, both ref
and :=
are functions in pervasives module
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gotcha, I was essentially quoting from pages/docs/manual/latest/mutation.mdx:
Assign a new value to `myValue` like so:
<CodeTab labels={["ReScript", "JS Output"]}>
\```res example
myValue.contents = 6
\```
\```js
myValue.contents = 6;
\```
</CodeTab>
We provide a syntax sugar for this:
<CodeTab labels={["ReScript", "JS Output"]}>
\```res example
myValue := 6
\```
\```js
myValue.contents = 6;
\```
</CodeTab>
Should I re-work this language as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added some comments. I think it's not important how this is implemented, we should just describe what it does and how it is useful.
@illusionalsagacity looking good, thanks! |
for #162