Mercurial > hg > xemacs-beta
diff lisp/cl-extra.el @ 5273:799742b751c8
Accept circular lists where that is useful in #'mapcar*, #'map* and friends.
src/ChangeLog addition:
2010-09-16 Aidan Kehoe <kehoea@parhasard.net>
* fns.c (Flist_length): New, moved here from cl-extra.el, needed
by the next function.
(shortest_length_among_sequences): New.
(Fmapconcat, FmapcarX, Fmapvector, Fmapcan, Fmapc, Fmap)
(Fmap_into, Fsome, Fevery):
Use shortest_length_among_sequences() when working out how many
iterations to do, only giving circular list errors if all
arguments are circular.
author | Aidan Kehoe <kehoea@parhasard.net> |
---|---|
date | Thu, 16 Sep 2010 20:34:49 +0100 |
parents | 30bf66dd3ca0 |
children | d27c1ee1943b 308d34e9f07d |
line wrap: on
line diff
--- a/lisp/cl-extra.el Thu Sep 16 18:46:05 2010 +0100 +++ b/lisp/cl-extra.el Thu Sep 16 20:34:49 2010 +0100 @@ -405,13 +405,6 @@ "Equivalent to (nconc (nreverse X) Y)." (nconc (nreverse x) y)) -(defun list-length (list) - "Return the length of LIST. Return nil if LIST is circular." - (if (listp list) - (condition-case nil (length list) (circular-list)) - ;; Error on not-a-list: - (car list))) - (defun tailp (sublist list) "Return true if SUBLIST is a tail of LIST." (while (and (consp list) (not (eq sublist list)))