Conversation
nevans
added this pull request to stack #775
October 3, 2026 00:32
This extracts a private inner API layer for number indexing and does the input/output conversion in the public API layer. The private API will be more convenient to work with internally, since we don't need to worry about accidentally comparing integers to `:*`. This comes at the small cost of some duplication. That duplication is considered less important here because 1) it's very simple, and 2) the implementations may drift apart: * `#at` converts _indexable_ runs into indexable nums, * `#ordered_at` converts _enumerable_ runs into indexable nums.
Since `set[2**32]` will _always_ be out of bounds, this makes no difference to the semantics. And it should have no effect on performance. Future performance optimizations can special case when we _know_ we must be scanning to the end, but that would check for `STAR_INT <= last`.
nevans
force-pushed
the
sequence_set/slice-refactoring
branch
from
October 3, 2026 13:42
b608d7f to
4bf5bb4
Compare
This branch has not been deployed
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.
With the tests from #773, we can be relatively confident these refactorings are safe and don't change any behavior.