Skip to content

replace an outgrown sort idiom; name the format-spec bytes#273

Merged
kacy merged 1 commit into
mainfrom
idiom-sweep
Jul 7, 2026
Merged

replace an outgrown sort idiom; name the format-spec bytes#273
kacy merged 1 commit into
mainfrom
idiom-sweep

Conversation

@kacy

@kacy kacy commented Jul 7, 2026

Copy link
Copy Markdown
Owner

summary

two items from the sprint's safe list (no state moves, no dispatch changes):

  • logscan's sorted_keys twelve-line insertion sort → m.keys().sort(). the hand-rolled sort predates working ordered string comparison (add logscan, a log analyzer in pith; fix ordered string comparison #258) — the language caught up to its own code. golden check byte-identical.
  • the format-spec lowering's bare bytes (60, 94, 62, 48, 32) now carry names: ALIGN_LEFT_BYTE, ALIGN_CENTER_BYTE, ALIGN_RIGHT_BYTE, FILL_ZERO_BYTE, FILL_SPACE_BYTE.

what was tested

full suite green (all four golden checks), fixed point byte-identical, seed refreshed, fmt gate clean.

two small readability payments from the elegance sprint's safe list.

logscan's sorted_keys carried a twelve-line insertion sort that
predates working ordered string comparison — the sort existed because
list.sort() couldn't be trusted before the pointer-compare fix. it is
now m.keys().sort(), and the golden check proves the output
unchanged.

the format-spec lowering used bare byte values for alignment and fill
characters; they now carry names (ALIGN_LEFT_BYTE and friends), so
the code says what the 60 meant.
@kacy kacy merged commit 15b048f into main Jul 7, 2026
2 checks passed
@kacy kacy deleted the idiom-sweep branch July 7, 2026 23:31
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.

1 participant