feat(#4752): add tt.as-ascii object#5219
Merged
Merged
Conversation
Contributor
🚀 Performance AnalysisAll benchmarks are within the acceptable range. No critical degradation detected (threshold is 100%). Please refer to the detailed report for more information. Click to see the detailed report
✅ Performance gain: |
asmirnov-backend
force-pushed
the
feat/4752/ascii
branch
from
June 14, 2026 20:52
ef6ec44 to
1a1b2ad
Compare
Part of objectionary#4752. Adds a pure-EO `tt.as-ascii` object that reads a single character as its ASCII numeric value (0-255), by widening the character's byte to the eight bytes `i64` expects and reading it back as a number. It is a small helper needed by the pure-EO `sprintf` reimplementation (and shared by the `up-cased`/`low-cased` siblings, which today each carry a private copy). Split into its own PR to keep the change small, mirroring the earlier `tt.is-digit` PR (objectionary#5208). The name follows the `as-...` value family of the core library (`as-bytes`, `as-i64`, `as-number`) and pairs with the existing sibling `tt.is-ascii`. It ships with inline `+>` tests covering the boundaries of the upper-case (`A`/`Z`), lower-case (`a`/`z`) and digit (`0`/`9`) ranges, plus space, punctuation (`!`) and the last printable character (`~`). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
asmirnov-backend
force-pushed
the
feat/4752/ascii
branch
from
June 14, 2026 20:58
1a1b2ad to
5e0d031
Compare
|
Contributor
Author
|
@yegor256, could you please take a look |
|
@asmirnov-backend Thanks for the contribution! You've earned +16 points. Please, keep them coming. Your running score is +44; don't forget to check your Zerocracy account too). |
yegor256
pushed a commit
that referenced
this pull request
Jun 23, 2026
Replaces the private nested `[char] > ascii` helper in `tt.up-cased` with the standalone `tt.as-ascii` object (added in #5219), and rewires `tt.low-cased` to call `tt.as-ascii` directly instead of borrowing the helper through the awkward `(up-cased text).ascii` expression. This removes the duplicated ASCII-decoding logic and drops the implicit dependency of `low-cased` on `up-cased`'s internals. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.



Part of #4752.
Adds a pure-EO
tt.as-asciiobject that reads a single character as itsASCII numeric value (0-255), by widening the character's byte to the eight
bytes
i64expects and reading it back as a number.It is a small helper needed by the pure-EO
sprintfreimplementation.