(in-package #:def) (defun take-until (pred list) "Returns two values: FRONT BACK. FRONT contains the first N members X of LIST for which (PRED X) is NIL. BACK contains everything after the members of FRONT. (EQUALP LIST (MULTIPLE-VALUE-BIND (FRONT BACK) (TAKE-UNTIL PRED LIST) (APPEND FRONT BACK)) Is always T." (loop :for (x . back) :on list :for fx? := (funcall pred x) :until fx? :collect x :into front :finally (return (values front (if fx? (cons x back) nil))))) (defun partition (pred list) "Returns two list values: YES NO. YES is everything for which PRED is T, NO is everything else." (loop :for e :in list :when (funcall pred e) :collect e :into yes :else :collect e :into no :finally (return (values yes no)))) (defun good-muffed-var-name-p (name &key (muffer "*")) (and (symbolp name) (string= muffer name :end2 (length muffer)) (string= muffer name :start2 (- (length (symbol-name name)) (length muffer))))) (defun lambda-opt-p (x) (find x '(cl:&optional cl:&key cl:&aux cl:&allow-other-keys cl:&rest) :test #'eq))