p Exercise 5.10 What is wrong with the following definition of s i mpl e - equa
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 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))
Fantastic news! We've Found the answer you've been seeking!
Step by Step Answer:
Related Book For
Paradigms Of Artificial Intelligence Programming Case Studies In Common Lisp
ISBN: 9781558601918
1st Edition
Authors: Peter Norvig
Question Posted: