Fix bug in accumulating in (chibi loop)

Accumulating has a bug that makes only lists supported, due to it ignoring the init value and always use the empty list. This fixes that.
This commit is contained in:
Linus Björnstam 2020-11-04 11:56:41 +01:00 committed by GitHub
parent 12636f4b19
commit c896bf90c5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -368,14 +368,14 @@
(accumulating (kons final i) ((var cursor) x) n . rest))
((accumulating (kons final init) ((var cursor) (expr (if check))) n . rest)
(n ((tmp-kons kons))
((cursor '() (if check (tmp-kons expr cursor) cursor)))
((cursor init (if check (tmp-kons expr cursor) cursor)))
()
()
((var (final cursor)))
. rest))
((accumulating (kons final init) ((var cursor) (expr)) n . rest)
(n ((tmp-kons kons))
((cursor '() (tmp-kons expr cursor)))
((cursor init (tmp-kons expr cursor)))
()
()
((var (final cursor)))