[movitz-cvs] CVS update: movitz/losp/muerte/lists.lisp
Frode Vatvedt Fjeld
ffjeld at common-lisp.net
Wed Jun 9 20:18:45 UTC 2004
Update of /project/movitz/cvsroot/movitz/losp/muerte
In directory common-lisp.net:/tmp/cvs-serv13331
Modified Files:
lists.lisp
Log Message:
Added adjoin.
Date: Wed Jun 9 13:18:45 2004
Author: ffjeld
Index: movitz/losp/muerte/lists.lisp
diff -u movitz/losp/muerte/lists.lisp:1.4 movitz/losp/muerte/lists.lisp:1.5
--- movitz/losp/muerte/lists.lisp:1.4 Thu Mar 18 01:24:23 2004
+++ movitz/losp/muerte/lists.lisp Wed Jun 9 13:18:45 2004
@@ -9,7 +9,7 @@
;;;; Created at: Tue Dec 5 18:40:11 2000
;;;; Distribution: See the accompanying file COPYING.
;;;;
-;;;; $Id: lists.lisp,v 1.4 2004/03/18 09:24:23 ffjeld Exp $
+;;;; $Id: lists.lisp,v 1.5 2004/06/09 20:18:45 ffjeld Exp $
;;;;
;;;;------------------------------------------------------------------
@@ -436,3 +436,18 @@
+(defun subsetp (list-1 list-2 &key (key 'identity) (test 'eql) test-not)
+ "=> generalized-boolean"
+ (let ((test (if test-not
+ (complement test-not)
+ test)))
+ (dolist (x list-1 t)
+ (unless (member x list-2 :key key :test test)
+ (return nil)))))
+
+(defun adjoin (item list &key (key 'identity) (test 'eql) test-not)
+ "=> new-list"
+ (let ((test (if test-not (complement test-not) test)))
+ (if (member (funcall key item) list :test test)
+ list
+ (cons item list))))
More information about the Movitz-cvs
mailing list