Changes for the better

* goof-impl.scm (loop/first loop/last): add ability to specify a
:default value. Added auxiliary syntax :default.
 * goof/iterators.scm (accumulating hash(q|v)ing): changed auxiliary
keyword from initial -> :initial.
 * goof.scm: export extra keywords
 * doc.html
 * doc.xml : document changes. fix bugs.
This commit is contained in:
Linus 2021-08-17 21:36:13 +02:00
parent 1de0a624f5
commit 832c414260
6 changed files with 77 additions and 61 deletions

View file

@ -373,10 +373,10 @@
(define-syntax accumulating
(syntax-rules (initial if :acc)
(syntax-rules (:initial if :acc)
((accumulating :acc (kons final init) ((var) . x) next . rest)
(accumulating :acc (kons final init) ((var cursor) . x) next . rest))
((accumulating :acc (kons final init) ((var cursor) ((initial i) . x)) n . rest)
((accumulating :acc (kons final init) ((var cursor) ((:initial i) . x)) n . rest)
(accumulating :acc (kons final i) ((var cursor) x) n . rest))
((accumulating :acc (kons final init) ((var cursor) (expr (if check))) n . rest)
(n ((tmp-kons kons))
@ -443,18 +443,18 @@
(syntax-rules ()
((_ name default-make setter)
(define-syntax name
(syntax-rules (:acc if initial)
(syntax-rules (:acc if :initial)
((_ :acc ((var) (key value)) n . rest)
(name :acc ((var) (key value (if #t) (initial default-make))) n . rest))
(name :acc ((var) (key value (if #t) (:initial default-make))) n . rest))
;; either init or if
((_ :acc ((var) (key value (if guard))) n . rest)
(name :acc ((var) (key value (if guard) (initial default-make))) n . rest))
(name :acc ((var) (key value (if guard) (:initial default-make))) n . rest))
((_ :acc ((var) (key value (initial init))) n . rest)
(name :acc ((var) (key value (if #t) (initial init))) n . rest))
(name :acc ((var) (key value (if #t) (:initial init))) n . rest))
;; both init and if
((_ :acc ((var) (key value (initial init) (if guard))) n . rest)
(name ((var) (key value (if guard) (initial init))) n . rest))
((_ :acc ((var) (key value (if guard) (initial init))) n . rest)
((_ :acc ((var) (key value (:initial init) (if guard))) n . rest)
(name ((var) (key value (if guard) (:initial init))) n . rest))
((_ :acc ((var) (key value (if guard) (:initial init))) n . rest)
(n
((var init))
((dummy (if #f #f) (if guard (setter var key value) (if #f #f))))