Partition should always return a list.

This commit is contained in:
Kyle 2015-09-01 02:22:23 -07:00
parent 782442afc8
commit 95fa8dcca9
1 changed files with 2 additions and 3 deletions

View File

@ -150,7 +150,7 @@ effectful code, such as logging."
(if (funcall test x)
(push x match)
(push x no-match)))
(vector match no-match)))
(list match no-match)))
(defun partition-vector (test vec)
(let ((match (new-vector))
@ -169,5 +169,4 @@ those that do not satisfy @c(pred)."
(cond
((listp seq) (partition-list pred seq))
((vectorp seq) (partition-vector pred seq))
(t (error "Values of type ~A cannot be partitioned."
(type-of seq)))))
(t nil)))