original commit: e0e63aacee7cb842635077a88d4f87aef0c54ed2
This commit is contained in:
Matthew Flatt 2002-07-09 00:27:19 +00:00
parent 53e9c04130
commit da9689d146

View File

@ -318,11 +318,12 @@
(polymorphic (polymorphic
(lambda (l) (lambda (l)
(if (pair? l) (if (pair? l)
(if (pair? (cdr l)) (let loop ((l l) (x (cdr l)))
(last-pair (cdr l)) (if (pair? x)
l) (loop x (cdr x))
(raise-type-error 'last-pair "pair" l))))) l))
(raise-type-error 'last-pair "pair" l)))))
(define cons? (lambda (x) (pair? x))) (define cons? (lambda (x) (pair? x)))
(define empty? (lambda (x) (null? x))) (define empty? (lambda (x) (null? x)))
(define empty '())) (define empty '()))