fix r6rs exists

svn: r9946
This commit is contained in:
Matthew Flatt 2008-05-24 17:25:39 +00:00
parent 1fcfc8a8e4
commit 7ec0f13a7d
2 changed files with 3 additions and 1 deletions

View File

@ -90,7 +90,7 @@
(define (exists1 proc list)
(if (null? list)
#t
#f
(let loop ((list list))
(let ((next (cdr list)))
(if (null? next)

View File

@ -13,6 +13,7 @@
(test (find even? '(3 1 4 1 5 9)) 4)
(test (find even? '(3 1 5 1 5 9)) #f)
(test (for-all even? '()) #t)
(test (for-all even? '(3 1 4 1 5 9)) #f)
(test (for-all even? '(3 1 4 1 5 9 . 2)) #f)
(test (for-all even? '(2 4 14)) #t)
@ -25,6 +26,7 @@
(test (exists even? '(3 1 4 1 5 9)) #t)
(test (exists even? '(3 1 1 5 9)) #f)
(test (exists even? '()) #f)
(test/exn (exists even? '(3 1 1 5 9 . 2)) &assertion)
(test (exists (lambda (n) (and (even? n) n)) '(2 1 4 14)) 2)
(test (exists < '(1 2 4) '(2 3 4)) #t)