Added copy-vector.

This commit is contained in:
shivers 1995-10-26 20:29:22 +00:00
parent e7460b6e74
commit 112a51bd10
1 changed files with 7 additions and 0 deletions

View File

@ -102,6 +102,13 @@
(and (pred (vector-ref v i)) (and (pred (vector-ref v i))
(lp (- i 1)))))) (lp (- i 1))))))
(define (copy-vector v)
(let* ((len (vector-length v))
(ans (make-vector len)))
(do ((i (- len 1) (- i 1)))
((< i 0) ans)
(vector-set! ans i (vector-ref v i)))))
;;; These two utility funs are for parsing optional last arguments, ;;; These two utility funs are for parsing optional last arguments,
;;; e.g. the PORT arg in ;;; e.g. the PORT arg in
;;; (write-string string [port]) ;;; (write-string string [port])