08/06/14 11:07:37
(list? '(1 . 2)) ;=> #f
(list? '()) ;=> #t
(list? '(1 2)) ;=> #t
(define (listp x)
(and (not (null? x))
(pair? x)))
(listp '(1 . 2)) ;=> #t
(listp '()) ;=> #f
(listp '(1 2)) ;=> #t
(define (non-nil-list? x)
(and (not (null? x))
(list? x)))
(non-nil-list? '(1 . 2)) ;=> #f
(non-nil-list? '()) ;=> #f
(non-nil-list? '(1 2)) ;=> #t