test(Dynamic): add missing tests for Dynamic and Dynamic.List#1504
Open
sqrew wants to merge 1 commit intocarp-lang:masterfrom
Open
test(Dynamic): add missing tests for Dynamic and Dynamic.List#1504sqrew wants to merge 1 commit intocarp-lang:masterfrom
sqrew wants to merge 1 commit intocarp-lang:masterfrom
Conversation
hellerve
reviewed
Mar 12, 2026
| (doc nthcdr "takes the `n`th tail or `cdr` of the list `pair`.") | ||
| (defndynamic nthcdr [n pair] | ||
| (cxr (list (+ n 1) 'd) pair)) | ||
| (cxr (list n 'd) pair)) |
Member
There was a problem hiding this comment.
This is not correct. nthcar and nthcdr are a symmetric pair. nthcar n and nthcdr n both go to position n, then take car/cdr.
Yes, this is different from how Common Lisp implements it.
cff1183 to
3f59251
Compare
Also fixes an off-by-one bug in nthcdr. Co-Authored-By: Gemini-CLI <gemini-cli@google.com>
3f59251 to
6f02c02
Compare
Contributor
Author
|
Updated the tests to align with Carp's symmetric definitions of |
Member
|
The Windows build failed due to a timeout unrelated to this PR. |
hellerve
approved these changes
Apr 2, 2026
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.
This PR fills the significant test coverage gap in the
DynamicandDynamic.Listmodules.Added Tests:
cxr,nthcdr,nthcar.collect-into,empty?,reduce,unreduce,filter,reverse,empty,take.apply,any?,all?,zip,map.flatten,walk,postwalk,prewalk,walk-replace.List.pairs,List.nth,List.remove-nth,List.update-nth,List.set-nth,List.find,List.find-index.Bug Fix:
Dynamic.nthcdr.Verified locally with
scripts/carp.sh -x test/list.carp.