This file is indexed.

/usr/lib/s9fes/vector-map.scm is in scheme9 2010.11.13-2.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
; Scheme 9 from Empty Space, Function Library
; By Nils M Holm, 2010
; See the LICENSE file of the S9fES package for terms of use
;
; (vector-map procedure vector ...)   ==>  vector
; (vector-map! procedure vector ...)  ==>  unspecific
;
; (load-from-library "vector-map.scm")
;
; Map a procedure over a set of vectors, giving a new vector
;
;       (vector (f (vector-ref v0 i) ... ) ...)
;
; where F is the given PROCEDURE, V0 is the first and VN is the last
; VECTOR specified. The arity of PROCEDURE must match the number of
; vectors passed to these procedures. VECTOR-MAP is to vectors what
; MAP is to lists.
;
; VECTOR-MAP! does not create a fresh vector, but changes the members
; of the *first* vector in situ.
;
; Example:   (vector-map + '#(1 2 3) '#(4 5 6))  ==>  #(5 7 9)
;            (let ((v (vector 1 2 3)))
;              (vector-map! - v)
;              v)                                ==>  #(-1 -2 -3)

(define (vector-map! f . v*)
  (if (null? v*)
      (error "vector-map!: too few arguments")
      (let ((k (apply min (map vector-length v*))))
        (do ((i 0 (+ 1 i)))
            ((>= i k))
          (vector-set! (car v*) i (apply f (map (lambda (x)
                                                  (vector-ref x i))
                                                v*)))))))

(define (vector-map f . v*)
  (if (null? v*)
      (error "vector-map: too few arguments")
      (let* ((k (apply min (map vector-length v*)))
             (n (make-vector k)))
        (do ((i 0 (+ 1 i)))
            ((>= i k)
              n)
          (vector-set! n i (apply f (map (lambda (x)
                                           (vector-ref x i))
                                         v*)))))))