Skip to content

test: add SRFI 1 spec examples for multi-list fold and fold-right#470

Open
aadiexii wants to merge 1 commit intoMoganLab:mainfrom
aadiexii:test/fold-multi-list-issue-190-clean
Open

test: add SRFI 1 spec examples for multi-list fold and fold-right#470
aadiexii wants to merge 1 commit intoMoganLab:mainfrom
aadiexii:test/fold-multi-list-issue-190-clean

Conversation

@aadiexii
Copy link
Contributor

Closes #190

What is the issue?
Issue #190 reported that fold and fold-right should accept a variable number of lists per the SRFI 1 specification.

What was found?
The multi-list support for fold and fold-right has already been implemented in the current codebase (the definitions use rest args . lists and handle both single and multi-list cases). The issue referenced an older commit (43bb071) where this was not yet the case.

What was changed?
Added the canonical SRFI 1 spec examples and additional edge-case tests to
tests/goldfish/liii/list-test.scm:

(fold cons* '() '(a b c) '(1 2 3 4 5)) — SRFI 1 spec example
(fold-right cons* '() '(a b c) '(1 2 3 4 5)) — SRFI 1 spec example
Three-list fold, single-element lists, and empty-list edge cases

554777423-dfd1ee4a-da27-43d0-960b-7e1074cffe5e

@aadiexii
Copy link
Contributor Author

Hey @da-liii Can you checkout this and lemme know if this need any improvements.

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.

Bug: SRFI 1 fold and fold-right

1 participant