From 734c478818312040e2de3a3a9ee9bf1f58f2e1d0 Mon Sep 17 00:00:00 2001 From: Colin Okay Date: Wed, 8 Jul 2020 18:24:58 -0500 Subject: renamed iter to for --- gtwiwtg.lisp | 10 +++++----- package.lisp | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/gtwiwtg.lisp b/gtwiwtg.lisp index 8e082c3..e3b571f 100644 --- a/gtwiwtg.lisp +++ b/gtwiwtg.lisp @@ -548,7 +548,7 @@ returns NIL." ;;; CONSUMERS -(defmacro iter ((var-exp gen) &body body) +(defmacro for ((var-exp gen) &body body) "The basic generator consumer. VAR-EXP can be either a symbol, or a form sutible for using as the @@ -561,7 +561,7 @@ procuded by GEN. Example: -(iter ((x y) (zip! (repeater 'a 'b 'c) (times 5))) +(for ((x y) (zip! (repeater 'a 'b 'c) (times 5))) (format t \"~a -- ~a~%\" x y)) A -- 0 @@ -627,7 +627,7 @@ Example: building data " `(let ((,acc ,init-val)) - (iter (,var-exp ,gen) + (for (,var-exp ,gen) (setf ,acc ,expr)) ,acc)) @@ -649,7 +649,7 @@ INDEXES is a list of non-negative integers. Returns a list of values from GEN such that each value was an element of indexes." (let ((acc (make-array (length indexes)))) - (iter ((x idx) (zip! gen (times (1+ (apply #'max indexes))))) + (for ((x idx) (zip! gen (times (1+ (apply #'max indexes))))) (when (member idx indexes) (loop :for i :below (length indexes) @@ -676,7 +676,7 @@ of indexes." "Consumes GEN, returning its average value." (let ((sum 0) (count 0)) - (iter (x gen) + (for (x gen) (incf sum x) (incf count)) (/ sum count))) diff --git a/package.lisp b/package.lisp index 5e7c452..f84fad6 100644 --- a/package.lisp +++ b/package.lisp @@ -24,7 +24,7 @@ #:merge! #:skip! #:skip-while! - #:iter + #:for #:fold #:collect #:take -- cgit v1.2.3