stylewarning / quickutil

The solution to the Utility Library problem.
87 stars 8 forks source link

SIFT (new utility) - Separate the wheat from the chaff. #50

Closed heegaiximephoomeeghahyaiseekh closed 8 years ago

heegaiximephoomeeghahyaiseekh commented 8 years ago
(defun sift (predicate list)
   "Returns two values from the LIST: A list of values that satisfy the PREDICATE,
and a list of those that don't."
   (loop for item in list
        if (funcall predicate item) collect item into gold
        else collect item into dirt
       finally (return (values gold dirt))))

Provides: sift Requires: Nothing Author: Jeremy Phelps License: Public Domain

stylewarning commented 8 years ago

Hello! Thanks for the submission. Have you seen partition-if?

stylewarning commented 8 years ago

I'm going to close. Please re-open if I missed something!