aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArun Isaac2024-09-27 16:08:00 +0100
committerArun Isaac2024-10-01 01:12:50 +0100
commitf0584ae3aa247c5738be7abf7040737865fd1aff (patch)
treea0d9a2b841c14b60858f9edbac9cb562dff833e1
parentc8926ea4f8cff24482de727c58adf279e880d311 (diff)
downloadravanan-f0584ae3aa247c5738be7abf7040737865fd1aff.tar.gz
ravanan-f0584ae3aa247c5738be7abf7040737865fd1aff.tar.lz
ravanan-f0584ae3aa247c5738be7abf7040737865fd1aff.zip
vectors: Add vector-member.
* ravanan/work/vectors.scm (vector-member): New public function.
-rw-r--r--ravanan/work/vectors.scm7
1 files changed, 6 insertions, 1 deletions
diff --git a/ravanan/work/vectors.scm b/ravanan/work/vectors.scm
index 45c87cb..f47c67b 100644
--- a/ravanan/work/vectors.scm
+++ b/ravanan/work/vectors.scm
@@ -32,7 +32,8 @@
vector-filter-map
vector-filter-map->list
vector-remove
- vector-find)
+ vector-find
+ vector-member)
#:re-export (vector-append
vector-for-each
vector-map
@@ -102,3 +103,7 @@ element exists, return @code{#f}."
(and (pred x)
x))
vec))
+
+(define (vector-member x vec)
+ "Return @code{#t} if @var{x} is a member of @var{vec}. Else, return @code{#f}."
+ (member x (vector->list vec)))