aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ravanan/vectors.scm12
1 files changed, 12 insertions, 0 deletions
diff --git a/ravanan/vectors.scm b/ravanan/vectors.scm
index 0b62abf..9c0dd49 100644
--- a/ravanan/vectors.scm
+++ b/ravanan/vectors.scm
@@ -25,6 +25,7 @@
vector-every
vector-fold))
#:export (vector-map->list
+ vector-append-map
vector-append-map->list
map->vector
vector-filter
@@ -49,6 +50,17 @@
first-vector
other-vectors)))
+(define (vector-append-map proc first-vector . other-vectors)
+ "Map @var{proc} over vectors and return a vector of the results appended
+together."
+ (apply vector-fold
+ (lambda (_ result . elements)
+ (vector-append result
+ (apply proc elements)))
+ (vector)
+ first-vector
+ other-vectors))
+
(define (vector-append-map->list proc first-vector . other-vectors)
"Map @var{proc} over vectors and return a list of the results appended
together."