diff options
author | Colin Okay <cbeok@protonmail.com> | 2020-07-08 20:42:34 -0500 |
---|---|---|
committer | Colin Okay <cbeok@protonmail.com> | 2020-07-08 20:42:34 -0500 |
commit | 2aeb1d46e8bfa2c976c9db54033ab6995ad6c5b4 (patch) | |
tree | 419ae2aad31ed71b0724d56417e02f121588c680 /examples.lisp | |
parent | 49b1053086af11a3fe8a143dfb981dd5bd11c748 (diff) |
another example
Diffstat (limited to 'examples.lisp')
-rw-r--r-- | examples.lisp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/examples.lisp b/examples.lisp index 83ba5c8..6d2f570 100644 --- a/examples.lisp +++ b/examples.lisp @@ -3,7 +3,8 @@ (:export #:perms #:all-primes - #:fibs)) + #:fibs + #:a-kind-of-grep)) (in-package :gtwiwtg.examples) @@ -109,3 +110,13 @@ vector VEC, one at a time." ;; subperms)))) ;; ;; which looks a little nicer but is less kind to the heap and to GC. + +;;; A kind of Grep ;;; + +(defmacro a-kind-of-grep (match-var key file &rest body) + `(for ,match-var (filter! (lambda (line) (search ,key line)) + (file-lines ,file)) + ,@body)) + + +;; find all export expressions in my bashrc file |