Two new words in crates/compiler/stdlib/imath.seq: #452
No reviewers
Labels
No labels
bug
dependencies
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
refactor
rust
technical-debt
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
navicore/patch-seq!452
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "bits-fmt"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Two new words in crates/compiler/stdlib/imath.seq:
Built on int->bits-padded + string.substring — slice into 4-char nibbles, glue back
with single-space separators. Header doc + Examples block updated; test cases cover
zero, the example value (40), all-ones in 8 bits (255 / 0xFF), the alternating
pattern in 16 bits (43690 / 0xAAAA), low bit only, and the high+low corner case
(32769 = 0x8001).
Nits (none blocking)
alternating pattern (1010 1010 1010 1010), not all-ones (that would be 65535 / 0xFFFF). The test values
themselves are correct — only the prose mislabels what the value represents. Worth fixing in the PR description
but not in code.
footnote already on file). Not tested or documented for the new words. Defensible: the new words are pure
formatters built on int->bits-padded, so anyone hitting a confusing result with a negative will land on the
existing header note. Optional one-liner cross-reference if you want belt-and-suspenders.
s+nibble-with-trailing-space ) helper, but with only two consumers the duplication is fine and the explicit
shape is easier to debug.
the natural inspection widths for the bitwise stdlib.
Style
Nothing in scope to change. Optional: tweak the PR description's "all-ones" wording.