Created
December 16, 2021 01:44
-
-
Save shirok/63b01e3638b838aa6fd1817198b22fc3 to your computer and use it in GitHub Desktop.
This file contains 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
(define (filter pred xs) | |
(define (skip xs) | |
(cond [(null? xs) xs] | |
[(pred (car xs)) xs] | |
[else (skip (cdr xs))])) | |
(unfold null? | |
(^[xs] (car xs)) | |
(^[xs] (skip (cdr xs))) | |
(skip xs))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment