Changed accumulator test/bind order to bind/test

This means vectoring exits directly when the index loop variable =
:length.

It also means :final has to change.
This commit is contained in:
Linus 2021-05-18 19:57:02 +02:00
parent aa77fef2ad
commit 7a1137e579
3 changed files with 71 additions and 66 deletions

View file

@ -512,13 +512,13 @@
;; 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.
;; executed until exhaustion.
(define-syntax final
(syntax-rules (:acc)
((_ :acc ((var) (test)) n . rest)
(n ()
((final #f test))
(final)
((var #f test))
()
()
()
. rest))))