ashinn / chibi-scheme

Official chibi-scheme repository
Other
1.2k stars 142 forks source link

SRFI 231: Fix for index-rotate #965

Closed gambiteer closed 2 months ago

gambiteer commented 2 months ago

The bounds are inclusive for this routine:

heine:~/programs/chibi-scheme> git diff
diff --git a/lib/srfi/231/base.scm b/lib/srfi/231/base.scm
index 9fc483fe..5b09a38b 100644
--- a/lib/srfi/231/base.scm
+++ b/lib/srfi/231/base.scm
@@ -24,7 +24,7 @@
 (define (index-rotate n k)
   (assert (and (exact-integer? n)
                (exact-integer? k)
-               (< -1 k n)))
+               (<= 0 k n)))
   (list->vector (append (iota (- n k) k) (iota k))))

 (define (index-first n k)