Big change: lexical scoping

This introduces lexical scoping of for clauses. See README.md
This commit is contained in:
Linus 2021-05-18 18:12:01 +02:00
parent 769553832b
commit 2c323be362
5 changed files with 132 additions and 63 deletions

View file

@ -508,6 +508,21 @@
((var var))
. rest))))
;; this is an internal "accumulator". It is used for final tests
;; :final in goof differs from in racket. It is lexical, meaning it
;; is tested where it is placed in the clauses, and any subloop is
;; executed completely.
(define-syntax final
(syntax-rules (:acc)
((_ :acc ((var) (test)) n . rest)
(n ()
((final #f test))
(final)
()
()
. rest))))
;;; Here starts generator clauses.
(define (generator->list gen)