Subject: is there a function like equal but for a list

From: [email-masked] (Dan Stanger)
Date: Fri, 10 Feb 1995 16:15:09 -0700

that is, it takes a list and returns nil if all elements are not the same?
thanks,
dan stanger

---

From: [email-masked] (Peter Dudey Drake)
Date: Fri, 10 Feb 95 21:57:04 PST

Is there any problem with this?

(defun all-equal (list)
	(every #'(lambda (x) (equal x (car list)))
		(rest list)))

Hmmm, would it be slightly more efficient to do this?

(defun all-equal (list)
	(every (function `(lambda (x) ,(car list)))
		(rest list)))

+-     PETER DUDEY DRAKE      279-D SE Lilly Ave.,  Corvallis, OR  97333     -+
|       MS student in Artificial Intelligence, Oregon State University        |
|                   Where I come from, we're ALL like this.                   |
+-  [email-masked]        (finger [email-masked])  -+