aboutsummaryrefslogtreecommitdiff
path: root/algebraic-structs.functor.vector.base.scm
blob: 2f44673f0c2edcedcff4ab121db7edbfae9aef12 (about) (plain)
1
2
3
4
5
6
7
8
9
10
(module (algebraic-structs functor vector base) (map)
  (import (rename scheme (map list-map))
          (only (chicken base) add1))

  (define (map f v)
    (let* ((len (vector-length v))
           (new (make-vector len)))
      (do ((i 0 (add1 i)))
          ((= i len) new)
        (vector-set! new i (vector-ref v i))))))