From 5055107b69e72457c37ed0ece91004665e4ad2e3 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Sun, 31 Jan 2021 16:27:13 +0100 Subject: Convert `filter` from a function to a macro Doesn't make a big difference, just for fun. I like the idea of a compile-time version of this since it's essentially just renaming `remove-if-not`. Move it to a new file so we can include it before it's used in `main.lisp`. --- l/src/macro.lisp | 4 ++++ l/src/main.lisp | 3 --- 2 files changed, 4 insertions(+), 3 deletions(-) create mode 100644 l/src/macro.lisp (limited to 'l/src') diff --git a/l/src/macro.lisp b/l/src/macro.lisp new file mode 100644 index 0000000..4d69294 --- /dev/null +++ b/l/src/macro.lisp @@ -0,0 +1,4 @@ +(in-package :extreload) + +(defmacro filter (predicate list-form) + `(remove-if-not ,predicate ,list-form)) diff --git a/l/src/main.lisp b/l/src/main.lisp index 6abe363..42c0ccd 100644 --- a/l/src/main.lisp +++ b/l/src/main.lisp @@ -91,6 +91,3 @@ "background_page"))) (filter #'extensionp targets))) - -(defun filter (predicate list-form) - (remove-if-not predicate list-form)) -- cgit v1.2.3