goof-loop/tests.scm

26 lines
618 B
Scheme
Raw Normal View History

;; This is just a file with things that should be written as a test. Dump file.
(loop ((:for a (in-list '(((1) (2)) ((3) (4)) ((5) (6 7)))))
:when #t
(:for b (in-list a))
:subloop
(:for c (in-list b))
(:acc acc (listing c)))
=> acc)
(loop ((:for a (in-list '((1 2) (3 4) (5 6))))
:subloop
(:for b (in-list a))
(:acc acc (listing b)))
=> acc)
(loop ((:for a (in-list '(1 2 3)))
(:acc oa (summing a))
:subloop
(:for b (up-from a (to (+ a 2))))
(:acc ob (listing b)))
=> (values oa ob))
;; Should return 6 and (1 2 2 3 3 4)