Conversation
Extract index-in-bounds?, index-out-of-bounds!, indexed-nth, indexed-lookup and indexed-invoke into xitdb.util.collection and use them from both array-list wrappers, replacing four copies of the bounds check and two identical valAt bodies. Restore the comment explaining why an in-range index can have no cursor. Route the three lazy-sequence checks in conversion through validation/validate-not-lazy-seq at the same point in each converter. No behavior change: 254 tests, 4266 assertions, 0 failures. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Fixes from the spec review of the history/cursor/vector lookup change: - Both write wrappers implement IFn, so a vector or list can be invoked inside a transaction with the same contract as the read view. - Linked-list wrappers use the shared index helpers: get returns nil or the default for negative, float, nil and keyword keys, nth throws out of bounds, and a stored nil stays distinct from a missing element. - validation/lazy-seq? also rejects repeat/cycle/iterate seqs and walks existing cons and chunked-cons cells to a lazy tail without realizing it. A seq of a lazy concat is therefore rejected too; LazySeqTest now builds its list with (apply list ...). - The deprecated history-index returns the latest zero-based index, the value deref-at accepts, and the return-history comment is accurate. The vector lookup test is renamed to indexed_lookup_test and runs over list storage in read, transaction, frozen and reopened-file views. 256 tests, 4867 assertions, 0 failures. Co-Authored-By: Claude Fable 5.1 <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.
Summary
Fix four correctness issues in history results, cursors, nested values, and vector lookups:
deref-at.swap!andreset!, including scoped before/after values when history returns are enabled.getkeys return nil or the supplied default;nthwithout a default and single-argument vector invocation retain their throwing behavior. Stored nil remains distinct from a missing element.These changes correct observable API behavior without changing the storage format.
Validation
clojure -M:test: 254 tests, 4,266 assertions, no failures or errors.git diff --checkpasses.