-
Notifications
You must be signed in to change notification settings - Fork 24
feat(Fift): Basic values page #1468
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 detailed Fift docs update; I’ve left one inline suggestion in languages/fift/basic-values.mdx to align the metadata with the existing conventions—please apply the inline suggestion.
| --- | ||
| title: "Basic values" | ||
| sidebarTitle: "Basic values" | ||
| 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.
[HIGH] noindex frontmatter value is incorrectly quoted as a string
In the frontmatter of the new languages/fift/basic-values.mdx page, the noindex key is set to the string "true" instead of the boolean true. The extended documentation style guide describes noindex: true as a supported boolean key and does not show quoted string values for this field, so this deviates from the documented convention for frontmatter metadata. Using a string here can cause inconsistencies in downstream tooling that expects a boolean and may parse or filter on this flag. Aligning this usage with the style guide helps keep frontmatter semantics consistent and predictable across the docs.
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.
Is this really an issue? I see that many pages use "true" as value.
| ## Strings | ||
|
|
||
| A string is any sequence of UTF-8 characters enclosed by double quotes `"`. When Fift recognizes a string, it pushes it into the Fift stack as a value of type `String`. For instance, `"Hello, world!"` pushes the corresponding `String` into the stack: | ||
|
|
||
| ```fift | ||
| "Hello, world!" | ||
| // String "Hello, world!" is at the top of the stack now | ||
| ``` | ||
|
|
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.
please add one sentence that " reads until the next " on the same line (no escaping, no multi‑line), like in the whitepaper
add info about multi-line strings ($<<""")
|
|
||
| ## Booleans | ||
|
|
||
| As described in the Types page, Fift does not have a separate type for booleans. Instead, booleans are emulated using `Integer`s, where `-1` represents truth, and `0` falsehood. Comparison primitives normally return `-1` to indicate success and `0` otherwise. Fift has the constants `true` and `false` to push these special integers into the stack: |
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 Types page
|
|
||
| Certain operations, like conditional execution of blocks and loops with exit conditions, extend the notion of "true" to any non-zero integer. However, if the intention is to work with bitwise operations over booleans, any non-zero integer must first be transformed into `-1`. Fift has the word `0<>` that transforms any non-zero integer into `-1`, and leaves `0` unchanged. 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.
code block tag (fift)
| 1 2 3 3 tuple | ||
| ``` | ||
|
|
||
| The list is really the nested tuple `[ 1 [ 2 [ 3 null ] ] ]`, while the tuple is simply `[ 1 2 3 ]`. |
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.
change
the tuple is simply
[ 1 2 3 ]
to a neutral
the tuple is
[ 1 2 3 ]
(styleguide anti‑pattern)
|
|
||
| ## Slices | ||
|
|
||
| A `Slice` is a read-only view of a portion of a `Cell`. Fift uses the syntax `b{<BINARY_DATA>}` and `x{<HEX_DATA>}` for defining slices. |
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 similar section about Bytes:
B{<HEX_DATA>}syntax- save to file
- etc.
Closes #1466.