summaryrefslogtreecommitdiffstats
path: root/lib.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib.c')
-rw-r--r--lib.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib.c b/lib.c
index fad9e198..cd470b8e 100644
--- a/lib.c
+++ b/lib.c
@@ -8565,6 +8565,18 @@ val rmismatch(val left, val right, val testfun_in, val keyfun_in)
left, right, nao);
}
+val starts_with(val little, val big, val testfun, val keyfun)
+{
+ val mm = mismatch(little, big, testfun, keyfun);
+ return tnil(!mm || eql(mm, length(little)));
+}
+
+val ends_with(val little, val big, val testfun, val keyfun)
+{
+ val mm = rmismatch(little, big, testfun, keyfun);
+ return tnil(!mm || eql(pred(neg(mm)), length(little)));
+}
+
static val take_list_fun(val env, val lcons)
{
cons_bind (list, count, env);