[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

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.                   |
+-  drakep@research.cs.orst.edu        (finger dudeyp@research.cs.orst.edu)  -+