X-Git-Url: http://git.kpe.io/?p=kmrcl.git;a=blobdiff_plain;f=lists.lisp;h=dfa9d386d25d5c9f100c317372442b3ef15adcff;hp=9793f273d863227009390e794295864af9e63536;hb=ea921dd2ce51a46bb3ca92a07df095d5ace99dcf;hpb=7446fd15be7c6b489b347d47526eb973f9ed7438 diff --git a/lists.lisp b/lists.lisp index 9793f27..dfa9d38 100644 --- a/lists.lisp +++ b/lists.lisp @@ -192,3 +192,12 @@ (setf ,plist (append ,plist (list ,pkey ,value))))))) +(defun unique-slot-values (list slot &key (test 'eql)) + (let ((uniq '())) + (dolist (item list (nreverse uniq)) + (let ((value (slot-value item slot))) + (unless (find value uniq :test test) + (push value uniq)))))) + + +