aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ravanan/work/vectors.scm6
1 files changed, 6 insertions, 0 deletions
diff --git a/ravanan/work/vectors.scm b/ravanan/work/vectors.scm
index 160ff3e..45c87cb 100644
--- a/ravanan/work/vectors.scm
+++ b/ravanan/work/vectors.scm
@@ -29,6 +29,7 @@
vector-append-map->list
map->vector
vector-filter
+ vector-filter-map
vector-filter-map->list
vector-remove
vector-find)
@@ -80,6 +81,11 @@ together."
"Return a vector with elements from @var{vec} that pass @var{pred}."
(list->vector (filter pred (vector->list vec))))
+(define (vector-filter-map proc vec)
+ "Map @var{proc} over @var{vec} and return a vector of the results that are not
+@code{#f}."
+ (list->vector (filter-map proc (vector->list vec))))
+
(define (vector-filter-map->list proc vec)
"Map @var{proc} over @var{vec} and return a list of the results that are not
@code{#f}."