Search found 2 matches

by pepsi7up
Thu Mar 22, 2012 4:55 am
Forum: Scheme
Topic: List Struture Equality
Replies: 10
Views: 31751

Re: List Struture Equality

ok whoops this is the Scheme channel. This might work if you replace the t form with an else one :o (defun list-structure-eq (l1 l2) (cond ((and (null l1) (null l2)) t) ((or (null l1) (null l2)) nil) ((and (listp (car l1)) (listp (car l2))) (and (list-structure-eq (car l1) (car l2)) (list-structure-...
by pepsi7up
Mon Mar 19, 2012 6:28 pm
Forum: Scheme
Topic: List Struture Equality
Replies: 10
Views: 31751

Re: List Struture Equality

(defun list-structure-eq (l1 l2) (cond ((and (null l1) (null l2)) t) ((or (null l1) (null l2)) nil) ((and (listp (car l1)) (listp (car l2))) (and (list-structure-eq (car l1) (car l2)) (list-structure-eq (cdr l1) (cdr l2)))) ((and (atom (car l1)) (atom (car l2))) (and (and (atom (car l1)) (atom (car...