aboutsummaryrefslogtreecommitdiff
path: root/algebraic-structures.functor.vector.base.scm
blob: 1449ed66c6f8ce73112a8e6296059138ffee945b (about) (plain)
1
2
3
4
5
6
7
8
9
10
(module (algebraic-structures 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))))))