splits the lst into 2 lists at the position where fn returns not nil
(defun split-if (fn lst) "splits the lst into 2 lists at the position where fn returns not nil" (let ((acc nil)) (do ((src lst (cdr lst))) ((or (null src) (funcall fn (car src))) (values (nreverse acc) src)) (push (car src) acc))))Source Context