diff --git a/collects/racket/private/for.rkt b/collects/racket/private/for.rkt index 1fd601a8c8..654425ab3a 100644 --- a/collects/racket/private/for.rkt +++ b/collects/racket/private/for.rkt @@ -420,7 +420,7 @@ (define (:vector-gen v start stop step) (values ;; pos->element - (lambda (i) (unsafe-vector-ref v i)) + (lambda (i) (unsafe-vector*-ref v i)) ;; next-pos ;; Minor optimisation. I assume add1 is faster than \x.x+1 (if (= step 1) add1 (lambda (i) (+ i step))) diff --git a/collects/tests/racket/for.rktl b/collects/tests/racket/for.rktl index bcd35ec4ba..d03c478227 100644 --- a/collects/tests/racket/for.rktl +++ b/collects/tests/racket/for.rktl @@ -110,6 +110,7 @@ (test-generator [(a b c)] (in-mlist (mlist 'a 'b 'c))) (test-generator [(a b c)] #(a b c)) (test-generator [(a b c)] (in-vector #(a b c))) +(test-generator [(a b c)] (in-vector (chaperone-vector #(a b c) (lambda (vec i val) val) (lambda (vec i val) val)))) (test-generator [(b c d)] (in-vector #(a b c d) 1)) (test-generator [(b c d)] (in-vector #(a b c d e) 1 4)) (test-generator [(b d f)] (in-vector #(a b c d e f g h) 1 7 2))