aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorColin Okay <cbeok@protonmail.com>2020-07-08 18:24:58 -0500
committerColin Okay <cbeok@protonmail.com>2020-07-08 18:24:58 -0500
commit734c478818312040e2de3a3a9ee9bf1f58f2e1d0 (patch)
tree25736d16e37d14e5c4677bdc56338d13f2f425ce
parent505125f0faf8c93a2e9a39148507cd9d21b8f691 (diff)
renamed iter to for
-rw-r--r--gtwiwtg.lisp10
-rw-r--r--package.lisp2
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