Repository navigation
Update the docs for Rue 0.13.0 - #16
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Updates the docs for Rue
0.12.0..0.13.0. Every claim was checked against the 0.13.0 source and CLI, and all 185rueblocks passscripts/check-rue-examples.pywith 0.13.0.Changes
docs/match.md): arms by type, narrowing, exhaustiveness, bindings in arms, arm conditions,matchstatements,inline match, the match lints, and why arms can't inspect function values.docs/loops.md):forexpressions that map, filter andfold, loops, several lists at once,for x, rest in xs, patterns,...for, and how loops compile.docs/type-system/enums.md): discriminants, how variants are represented at runtime, field-less enums as atoms, generic enums, and gotchas.ifstatements anywhere in a block, assert messages,Neverconditions.-> Never, and the inlining rules.prelude_over_enclosing_item,project::, the private re-export rules, named imports over globs.&&/||returning the right operand,bool_operator_may_raise.'...', byte indexing and slicing,Never, hex literals assigned toInt.imprecise_narrowing, the size limits.redundant_union_memberandindistinguishable_union_member.substrremoved,keccak256_verify,modpow/keccak256requiringhard_fork_2, operand limits, spreads into list builtins.enum Condition, the removedopcodefield,length/reverse/contains,merge_listremoved.--operand-limits,--hard-fork-2,--debug-metadata, stack traces. All output is pasted from real runs.rue lints.operand_limits,hard_fork_2(with a Targeting Mainnet section),single_quote, and therue initmanifest.inlayHintssetting.in/foldonly inforheaders),'...'strings, escapes,..andNever, and no longer colours keywords likelet (as calls.hard_fork_2info string compiles a block with--hard-fork-2, for themodpowandkeccak256examples. It's documented in the script and the update-rue-docs skill.Tutorials
Not re-tested. No
chia-wallet-sdkrelease uses Rue 0.13.0 yet (0.39.0 depends onrue-compiler ^0.12.0), so their "last tested with" versions are unchanged.Possible compiler or CLI issues (documented as they behave)
const mainwarns: the release notes suggestconst mainas a way to make a constant the program, butconst main: Int = 42;always triggersnaming_convention(SCREAMING_SNAKE_CASE). The constants page recommendsexport constwithrue build --exportinstead.Nevercall doesn't end a branch:if v is Int { fail("x"); }, wherefailreturnsNever, doesn't narrow the code after theif, whileraiseandreturn fail("x");do. The functions page documents this.rue debugdrops raised values: it prints onlyError: clvm raise, whilerue testshows the raised value.unchecked_cast(x) is Bytes32: the release notes say this now checks at runtime, but it's a "Cannot infer generic" error. The guards page usesunchecked_cast::<Any>(x) is Bytes32.Note
Low Risk
Only documentation, the syntax highlighter and the docs' example checker change. The example check, prettier, typecheck and build (which fails on broken links and anchors) all pass, and two independent reviews checked the prose against the 0.13.0 source. The worst case is an inaccurate statement in the docs.
hard_fork_2info string inscripts/check-rue-examples.pyand the skill.