Commit graph

66 commits

Author SHA1 Message Date
Linus
2dc4a72790 Added pattern matching
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)
2020-12-02 21:17:42 +01:00
Linus
093d1319d9 Fixed a bug with a forgotten :acc.
Inlined the in-file bindings, with the risk of exposing it to a misguided set!.
2020-12-01 20:54:42 +01:00
Linus
c53a08c769 Made simple loops better. Now with correct syntax proliferation.w 2020-12-01 20:53:25 +01:00
Linus
0c110dd080 Big, buggy commit
: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.
2020-11-25 20:40:48 +01:00
Linus
1a826f86e2 Undid racketification, because not diffrentiating between :for and :acc means that errors become very strange and unhelpful.
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)
2020-11-22 21:47:48 +01:00
Linus
80464ebe48 Added some simple versions of loop
loop/first loop/last loop/sum loop/product now added.
2020-11-09 23:18:58 +01:00
Linus
17d72f2cea Added generator sequences
Basic hack of in-cycle and in-indexed
2020-11-09 22:57:18 +01:00
Linus
30b73286b3 Forgot some updates in the readme to accompany previous commit. 2020-11-09 13:44:55 +01:00
Linus
a3244a065a Update readme to reflect recent changes.wq 2020-11-09 13:35:43 +01:00
Linus
2c182da570 Racketifying goof-loop
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 ...))
2020-11-09 13:30:02 +01:00
Linus
716c26c7ce Removed unused, undefined exports.
Shedded some garbage from helpers.scm
2020-11-04 23:20:19 +01:00
Linus
be9ac1a55d Intermediate loops
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
2020-11-04 23:15:32 +01:00
Linus
f2496604d5 Fixed named update and a bug in accumulating
* goof.scm: Removed positional updates and fixed named updates
 * iterators.scm: Fixed bug in accumulating where only lists were supported.
2020-11-04 11:58:58 +01:00
Linus
b3efccb4aa Clarified readme regarding named update. 2020-11-02 22:20:52 +01:00
Linus
dd86fc8a0b Added a LICENCE file and fixed a small readme error. 2020-11-02 22:17:48 +01:00
Linus
ef96da9658 First commit 2020-11-02 22:11:45 +01:00