mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-05-18 21:29:19 +02:00
Fix flatten-vector->list on empty vectors.
Closes #976. Complements of Bradley Lucier.
This commit is contained in:
parent
2b1d2d99a8
commit
11984c6eb3
1 changed files with 3 additions and 1 deletions
|
@ -578,7 +578,9 @@
|
||||||
(define (flatten-vector->list vec d)
|
(define (flatten-vector->list vec d)
|
||||||
(cond
|
(cond
|
||||||
((not (vector? vec)) '())
|
((not (vector? vec)) '())
|
||||||
((and (positive? d) (vector? (vector-ref vec 0)))
|
((and (positive? d)
|
||||||
|
(positive? (vector-length vec))
|
||||||
|
(vector? (vector-ref vec 0)))
|
||||||
(append-map (lambda (x) (flatten-vector->list x (- d 1)))
|
(append-map (lambda (x) (flatten-vector->list x (- d 1)))
|
||||||
(vector->list vec)))
|
(vector->list vec)))
|
||||||
(else (vector->list vec))))
|
(else (vector->list vec))))
|
||||||
|
|
Loading…
Add table
Reference in a new issue