; Test if argument is an atom. ; Taken from The Little Schemer, page 10. (define atom? (lambda (x) (and (not (pair? x)) (not (null? x))) ) ) ;============== Unit Tests ====================== (load "test.scm") (define msg "atom?") (test msg (atom? 5) #t) (test msg (atom? 'hello) #t) (test msg (atom? (car '(a b c))) #t) (test msg (atom? '()) #f) (test msg (atom? '(a b c)) #f) (test msg (atom? (cdr '(a b c))) #f)