9.sld 364 B

123456789101112131415
  1. (define-library (aop 9)
  2. (import (scheme base))
  3. (export vector-generator)
  4. (begin
  5. (define (vector-generator gen-proc)
  6. (lambda (size)
  7. (list->vector
  8. (let loop ((i 0)
  9. (out '()))
  10. (if (< i size)
  11. (loop (+ i 1)
  12. (cons (gen-proc i) out))
  13. (reverse out))))))))