Question: p Exercise 5.10 What is wrong with the following definition of s i mpl e - equa 1 ? (defun simple-equal (x y) Test if
p Exercise 5.10 What is wrong with the following definition of s i mpl e - equa 1 ?
(defun simple-equal (x y)
"Test if two l i s t s or atoms are equal."
;; Warning - incorrect
(or (eql x y)
(and (listp x) (listp y)
(simple-equal ( f i r s t x) ( f i r s t y))
(simple-equal (rest x) (rest y)) 1))
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
