-
Notifications
You must be signed in to change notification settings - Fork 35
feat(Fift): Words, Constants and Variables page #1472
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
base: main
Are you sure you want to change the base?
Conversation
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.
Thanks for the update—languages/fift/variables.mdx: one inline suggestion to align the wording with your style guide. Please apply the inline suggestion.
| // Define word x so that it reads the box contents. | ||
| // Now, x can be treated as if | ||
| // it was the "variable". | ||
| // In other words, instead of writing "x-box @" | ||
| // to read the variable contents, simply write "x". | ||
| { x-box @ } : x |
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.
[HIGH] Banned filler word “simply” in body text
The comment explaining the getter x includes the phrase “simply write x” on these lines. The extended style guide explicitly bans filler and hedging terms like “simply” in instructional text and requires neutral, precise wording instead, so this phrasing violates a MUST-NOT rule and creates an inconsistent tone. Replacing “simply” with neutral language keeps the instruction clear while aligning with the documented style requirements, as outlined in https://github.com/ton-org/docs/blob/main/contribute/style-guide-extended.mdx?plain=1#L214-L220.
| // Define word x so that it reads the box contents. | |
| // Now, x can be treated as if | |
| // it was the "variable". | |
| // In other words, instead of writing "x-box @" | |
| // to read the variable contents, simply write "x". | |
| { x-box @ } : x | |
| // Define word x so that it reads the box contents. | |
| // Now, x can be treated as if | |
| // it was the "variable". | |
| // In other words, instead of writing "x-box @" | |
| // to read the variable contents, write "x". | |
| { x-box @ } : x |
Please leave a reaction 👍/👎 to this suggestion to improve future reviews for everyone!
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.
Done.
pyAndr3w
left a comment
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.
👍
languages/fift/variables.mdx
Outdated
|
|
||
| ## Words | ||
|
|
||
| A _word_ is an identifier for an execution token, also known as a `WordDef`. To define a new word, first define a `WordDef` by enclosing code inside `{ }`; then invoke word `:` followed by the identifier for the word. For instance, |
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.
phrase
identifier for an execution token, also known as a
WordDef
may be confusing after editing types.mdx
|
|
||
| ## Variables | ||
|
|
||
| _Variables_ are a much more efficient way to represent changeable values. To declare a variable, use the word `variable` followed by the identifier. Internally, the word `variable` creates an empty box, which can then be updated with word `!`, and read with word `@`. |
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 would show that variable x is the same as hole constant x and link to { hole constant } : variable in Fift.fif.
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.
Done.
languages/fift/variables.mdx
Outdated
| // it inside the block/execution token. | ||
| does // Stack: { Box WordDef-for-! execute } | ||
| // Assign the block/execution token { Box WordDef-for-! execute } | ||
| // to the second string comming after the invocation of variable-get-set |
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.
fix the comment typo comming > coming
| y // Top of stack has 5 | ||
| ``` | ||
|
|
||
| For more details on blocks/execution tokens and words `' <WORD_NAME>` and `execute`, refer to the Blocks Section in the Control Flow page. For more details on words `create`, `' <WORD_NAME>`, `does`, refer to Sections [4.5](/languages/fift/whitepaper#4-5-defining-words-and-dictionary-manipulation), [4.6](/languages/fift/whitepaper#4-6-dictionary-lookup), and [4.7](/languages/fift/whitepaper#4-7-creating-and-manipulating-word-lists) in the Fift whitepaper. |
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.
add link to /languages/fift/control#blocks
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.
Addressed in issue #1556. Links cannot be solved in this PR because other PRs need to be merged into main first.
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.
Thanks for the Fift docs addition; I’ve left a couple of suggestions in languages/fift/variables.mdx: please apply the inline suggestions to align with the existing docs conventions.
languages/fift/variables.mdx
Outdated
| title: "Words, Constants, and Variables" | ||
| sidebarTitle: "Words, Constants, and Variables" |
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.
[HIGH] Page title and sidebar title not in sentence case
The frontmatter title and sidebarTitle currently use title case ("Words, Constants, and Variables"), capitalizing common nouns instead of following sentence case. The documentation style guide requires headings and titles to capitalize only the first word and proper nouns, and marks violations of this rule as high severity (see https://github.com/ton-org/docs/blob/main/contribute/style-guide-extended.mdx?plain=1#L445-L452 for the sentence case rule). Leaving these in title case creates inconsistency across navigation and search listings where these titles are displayed. Aligning them with sentence case improves coherence and adherence to the established documentation standards.
| title: "Words, Constants, and Variables" | |
| sidebarTitle: "Words, Constants, and Variables" | |
| title: "Words, constants, and variables" | |
| sidebarTitle: "Words, constants, and variables" |
Please leave a reaction 👍/👎 to this suggestion to improve future reviews for everyone!
| --- | ||
| title: "Words, Constants, and Variables" | ||
| sidebarTitle: "Words, Constants, and Variables" | ||
| noindex: "true" |
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.
[MEDIUM] Frontmatter noindex uses string instead of boolean
The frontmatter sets noindex: "true" as a string literal instead of a boolean flag. The style guide’s frontmatter rules expect supported keys like noindex to use their correct types (for example, noindex: true) so that Mintlify and related tooling can interpret metadata reliably. Using a string here risks inconsistent indexing behavior compared to other pages that follow the noindex: true pattern.
| noindex: "true" | |
| noindex: true |
Please leave a reaction 👍/👎 to this suggestion to improve future reviews for everyone!
Closes #1467.