Added some tests.

Fixed some things I noticed when testing the tests.
This commit is contained in:
Linus 2021-03-22 19:29:16 +01:00
parent 524933d29f
commit 3908019bbc
4 changed files with 235 additions and 33 deletions

View file

@ -40,13 +40,13 @@
(define-syntax in-list
(syntax-rules (:for)
((in-list:for ((var) source) next . rest)
((in-list :for ((var) source) next . rest)
(in-list :for ((var cursor) source) next . rest))
((in-list:for ((var cursor) source) next . rest)
((in-list :for ((var cursor) source) next . rest)
(in-list :for ((var cursor succ) source) next . rest))
((in-list:for ((var cursor succ) (source)) next . rest)
((in-list :for ((var cursor succ) (source)) next . rest)
(in-list :for ((var cursor succ) (source cdr)) next . rest))
((in-list:for ((var cursor succ) (source step)) next . rest)
((in-list :for ((var cursor succ) (source step)) next . rest)
(next
;; outer let bindings, bound outside the loop, unchanged during the loop
()
@ -63,9 +63,9 @@
. rest))
;; Generator-clauses
((in-listlst)
((in-list lst)
(gen-list lst))
((in-list(var) (expr step))
((in-list (var) (expr step))
(gen-list lst step))))
(define gen-list