mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-05-19 05:39:18 +02:00
add check for empty second list in list= (fixes issue #407)
This commit is contained in:
parent
fad9e4ca8b
commit
779c60ac35
2 changed files with 4 additions and 1 deletions
|
@ -29,7 +29,8 @@
|
|||
(if (null? ls1)
|
||||
(and (null? ls2)
|
||||
(lp1 (cdr lists)))
|
||||
(and (eq (car ls1) (car ls2))
|
||||
(and (pair? ls2)
|
||||
(eq (car ls1) (car ls2))
|
||||
(lp2 (cdr ls1) (cdr ls2))))))))
|
||||
|
||||
(define (length+ x)
|
||||
|
|
|
@ -32,6 +32,8 @@
|
|||
(test #f (pair? 'a))
|
||||
(test #t (list= eq?))
|
||||
(test #t (list= eq? '(a)))
|
||||
(test #f (list= = '(1 2) '(1 2 3)))
|
||||
(test #f (list= = '(1 2 3) '(1 2)))
|
||||
(test 'a (car '(a b c)))
|
||||
(test '(b c) (cdr '(a b c)))
|
||||
(test '(a) (car '((a) b c d)))
|
||||
|
|
Loading…
Add table
Reference in a new issue