Skip to content

feat(#4752): add tt.is-digit object#5208

Merged
yegor256 merged 2 commits into
objectionary:masterfrom
asmirnov-backend:feat/#4752/is-digit
Jun 14, 2026
Merged

feat(#4752): add tt.is-digit object#5208
yegor256 merged 2 commits into
objectionary:masterfrom
asmirnov-backend:feat/#4752/is-digit

Conversation

@asmirnov-backend

Copy link
Copy Markdown
Contributor

Part of #4752.

Adds a pure-EO tt.is-digit object that checks whether text
contains only decimal digits. It's a small helper needed by the
pure-EO sprintf reimplementation (to detect positional argument
indices like %1$s), split into its own PR to keep the change small.

It mirrors the existing sibling objects tt.is-alpha, tt.is-ascii
and tt.is-alphanumeric: same headers, +alias tt.regex, and inline
+> tests.

🤖 Generated with Claude Code

@github-actions

github-actions Bot commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

🚀 Performance Analysis

All 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
Test Base Score PR Score Change % Change Unit Mode
benchmarks.XmirBench.xmirToEO 10973.261 10952.912 -20.349 -0.19% ms/op Average Time

✅ Performance gain: benchmarks.XmirBench.xmirToEO is faster by 20.349 ms/op (0.19%)

Pure-EO `is-digit` checks that `text` contains only decimal digits,
needed as a helper for the pure-EO `sprintf` reimplementation.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@sonarqubecloud

Copy link
Copy Markdown

@asmirnov-backend

Copy link
Copy Markdown
Contributor Author

@yegor256, could you please take a look

@yegor256
yegor256 merged commit 38e39e2 into objectionary:master Jun 14, 2026
26 checks passed
asmirnov-backend added a commit to asmirnov-backend/eo that referenced this pull request Jun 14, 2026
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 added a commit to asmirnov-backend/eo that referenced this pull request Jun 14, 2026
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>
@0crat

0crat commented Jun 14, 2026

Copy link
Copy Markdown

@asmirnov-backend Thanks for the contribution! You've earned +16 points following our bonus policy - you received the base 16 points for reviews, plus additional points for your hits-of-code contribution. Please, keep them coming as quality contributions like this help maximize your rewards! Your running score is +16; don't forget to check your Zerocracy account too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants