Created
June 20, 2011 01:16
-
-
Save gvinter/1034982 to your computer and use it in GitHub Desktop.
Does alist contain x?
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 (contains x alist) | |
(define (foldl f(x accum) alist) | |
(null? alist) | |
#false | |
(if (= (car alist) x) | |
#true | |
(foldl f(x accum) (cdr alist)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment