From 8b0060a6b029eb5600abe0d8187c28d354dd7a33 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Sat, 30 Jan 2021 16:37:25 +0100 Subject: main.lisp: Change `filter` to use `remove-if-not` Just learned about `remove-if-not`. Really cleans up this function. Not even really necessary to keep `filter`, but I guess I'll hold on to it for now. --- l/src/main.lisp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'l/src') diff --git a/l/src/main.lisp b/l/src/main.lisp index 0689107..a75fbc3 100644 --- a/l/src/main.lisp +++ b/l/src/main.lisp @@ -94,9 +94,4 @@ (filter #'extensionp targets))) (defun filter (predicate list-form) - (let ((newl '())) - (dolist (el list-form) - (if (funcall predicate el) - (push el newl))) - - newl)) + (remove-if-not predicate list-form)) -- cgit v1.2.3