CS 3304: Comparative Languages |
FP Foundations, Scheme |
[ Course Documents ] : [ FP Foundations, Scheme ] | ||||||||
|
(define (equal lis1 lis2) (cond ((not (list? lis1)) (eqv? lis1 lis2)) ((not (list? lis2)) '()) ((null? lis1) (null? lis2)) ((null? lis2) '()) ((equal (car lis1) (car lis2)) (equal (cdr lis1) (cdr lis2))) (else '()) ) )