projects
/
jscl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
TAILP
[jscl.git]
/
src
/
list.lisp
diff --git
a/src/list.lisp
b/src/list.lisp
index
bbb7557
..
173dedf
100644
(file)
--- a/
src/list.lisp
+++ b/
src/list.lisp
@@
-116,6
+116,12
@@
(tree-equal (car tree1) (car tree2) :test test)
(tree-equal (cdr tree1) (cdr tree2) :test test))))
(tree-equal (car tree1) (car tree2) :test test)
(tree-equal (cdr tree1) (cdr tree2) :test test))))
+(defun tailp (object list)
+ (do ((tail list (cdr tail)))
+ ((atom tail) (eq object tail))
+ (when (eql tail object)
+ (return-from tailp t))))
+
(defun subst (new old tree &key (key #'identity) (test #'eql))
(cond
((funcall test (funcall key tree) (funcall key old))
(defun subst (new old tree &key (key #'identity) (test #'eql))
(cond
((funcall test (funcall key tree) (funcall key old))