egallesio / STklos

STklos Scheme
http://stklos.net
GNU General Public License v2.0
69 stars 17 forks source link

Fix behavior of `vector-copy` in SRFI 43 #581

Closed jpellegrini closed 1 year ago

jpellegrini commented 1 year ago

The procedure should augment the vector as necessary, even if there's no fill argument...

(define v (make-vector 5 -1))
v => #(-1 -1 -1 -1 -1)

(vector-copy v 0 8)

The above currently triggers an error, but SRFI 43 says it should augment the vector with an unspecified argument...

This patch fixes this:

(vector-copy v 0 8) => #(-1 -1 -1 -1 -1 #void #void #void)
egallesio commented 1 year ago

Thanks @jpellegrini. Merged.