Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Tree: d43c4e0f71
Fetching contributors…

Cannot retrieve contributors at this time

31 lines (24 sloc) 0.573 kB
(define even (lambda (x)
(= 0 (mod x 2))))
(define odd (lambda (x)
(not (even x))))
(define all (lambda (f l)
(if (not (null? l))
(if (f (car l))
(all f (cdr l))
#f)
#t )))
(define any (lambda (f l)
(if (not (null? l))
(if (f (car l))
#t
(any f (cdr l)))
#f )))
(all even `(2 4 6))
; => #t
(all even `(2 4 5))
; => #f
(any even `(1 3 6))
; => #t
(any even `(1 3 5))
; => #f
Jump to Line
Something went wrong with that request. Please try again.