There is no need for :acc clauses to intoduce loop variables, or for :for clauses to introduce acc clauses.
They are now changed.
* goof.scm (cl-next/acc cl-next/for): removed the unused matchings for loop-vars and acc-vars respectively.
* goof/iterators.scm (all iterators): simplified it.
This is a bug I never hit, due to me only having accumulators that gets passed along. However,
something like vectoring or hashing should behave like (in-vector ...), which means the let binding
needs to be propagated upwards.
* goof.scm change cl-next/acc to promote let bindings for accumulators to the outermost let.
* README.md: added some small documentation and loop expansion.
* goof.scm: Changed the iterator protocol to not use unnecessary :acc and :fors.
* iterators.scm: see above.
* ref-let.scm: a new macro to allow multiple values and pattern matching to co-exist for body-bindings.
ref variables now do pattern matching. This means that, say, the
variable binding the (car cursor) in (in-list ...) can be a (ice-9 match) pattern:
(loop/list (((a . b) (in-list '((1 ignore) (2 ignore) (3 ignore))))
a)
;; => (1 2 3)
:for clauses now have finalizers! This means (in-file "path") now works. This meant I had to do some restructuring of many nasty pieces of code, but I believe it works. cl-next was broken up into cl-next/acc and cl-next/for. Accumulators have to pass :acc to (cl-next/acc ...). I plan for :for clauses to do the same.
I fixed tests.scm and README.md to reflect the de-racketification of the for loops.
Added simple forms, like loop/list that accumulates bodies into a list.
Add :final that works like in racket:
(loop/list ((:for a (in-list '(1 2 3))) :final (= a 2)) (display a))
=> (1 2)
I have racketified goof loops. No :for or :acc needed, and :when, :unless, and :break are no longer parethesised.
:acc blah (in ...) and :for blah (in ...) has been changed to
(blah (folding ...)) and (blah (in ...))
goof.scm
* Changed cl-next to properly push all intermediate loops
* Changed emit-many/rest to emit intermediate loops
* Added loop/list as a shorthand for just accumulating lists.
tests.scm
* Collected some things I wanted ta have to track regressions.
README.md
* Reflect above changes