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

[no subject]



This idea is from CWH/ALAN (and many others I am sure).  I agree, comments?

----------

(1)	LENGTH should count the number of conses in a given structure, i.e.
	(LENGTH '(A B . C)) --> 2.  Here is how I think it should behave:

	(defun length (list)
	       (cond ((atom list) 0)
		     (t (1+ (length (cdr list))))))

(2)	LAST should return the last cons in a given structure, i.e.
	(LAST '(A B . C)) --> (B . C).  Here is a definition:

	(defun last (list)
	       (cond ((atom (cdr list)) list)
		     (t (last (cdr list)))))


---------
End of idea.