From 3e45fe2826a6abbf5fcb51b582e7e008128267a7 Mon Sep 17 00:00:00 2001 From: Colin Okay Date: Fri, 10 Jul 2020 00:18:47 -0500 Subject: updated readme, changed grep example --- examples.lisp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'examples.lisp') diff --git a/examples.lisp b/examples.lisp index 6d2f570..221c78e 100644 --- a/examples.lisp +++ b/examples.lisp @@ -113,10 +113,9 @@ vector VEC, one at a time." ;;; 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)) +(defun grepper (pattern file) + (filter! (lambda (idx-line) (search pattern (second idx-line))) + (zip! (range) (file-lines file)))) ;; find all export expressions in my bashrc file -- cgit v1.2.3