Add `anding` and `oring` iterate clauses
author |
Steve Losh <steve@stevelosh.com> |
date |
Sun, 07 May 2017 23:41:20 +0000 |
parents |
6a26564cc9a8
|
children |
410ea6dead95
|
branches/tags |
(none) |
files |
DOCUMENTATION.markdown losh.lisp package.lisp |
Changes
--- a/DOCUMENTATION.markdown Wed Apr 12 13:09:00 2017 +0000
+++ b/DOCUMENTATION.markdown Sun May 07 23:41:20 2017 +0000
@@ -805,7 +805,8 @@
### `GNUPLOT` (function)
- (GNUPLOT DATA &REST ARGS &KEY (X #'CAR) (Y #'CDR) &ALLOW-OTHER-KEYS)
+ (GNUPLOT DATA &REST ARGS &KEY (X #'CAR) (Y #'CDR) (SPEW-OUTPUT NIL)
+ &ALLOW-OTHER-KEYS)
Plot `data` to `filename` with gnuplot.
--- a/losh.lisp Wed Apr 12 13:09:00 2017 +0000
+++ b/losh.lisp Sun May 07 23:41:20 2017 +0000
@@ -1525,6 +1525,14 @@
(with ,hash-table = (make-hash-table :test ,test))
(setf (gethash ,key ,hash-table) ,value)))))
+(defmacro-clause (ORING expr &optional INTO var)
+ (let ((result (or var iterate::*result-var*)))
+ `(reducing ,expr :by #'or :into ,var :initial-value nil)))
+
+(defmacro-clause (ANDING expr &optional INTO var)
+ (let ((result (or var iterate::*result-var*)))
+ `(reducing ,expr :by #'and :into ,var :initial-value t)))
+
(defun keywordize-clause (clause)
(iterate
--- a/package.lisp Wed Apr 12 13:09:00 2017 +0000
+++ b/package.lisp Sun May 07 23:41:20 2017 +0000
@@ -156,6 +156,7 @@
(:export
:across-flat-array
+ :anding
:averaging
:collect-hash
:cycling
@@ -170,6 +171,7 @@
:into
:macroexpand-iterate
:modulo
+ :oring
:pairs-of-list
:per-iteration-into
:real-time