summaryrefslogtreecommitdiffstats
path: root/lib.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib.c')
-rw-r--r--lib.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/lib.c b/lib.c
index 3d26183d..b9fb4210 100644
--- a/lib.c
+++ b/lib.c
@@ -4202,6 +4202,13 @@ val split_str_keep(val str, val sep, val keep_sep)
}
}
+val spl(val sep, val arg1, val arg2)
+{
+ return if3(missingp(arg2),
+ split_str_keep(arg1, sep, arg2),
+ split_str_keep(arg2, sep, arg1));
+}
+
val split_str(val str, val sep)
{
return split_str_keep(str, sep, nil);
@@ -4287,6 +4294,13 @@ val tok_str(val str, val tok_regex, val keep_sep)
return out;
}
+val tok(val tok_regex, val arg1, val arg2)
+{
+ return if3(missingp(arg2),
+ tok_str(arg1, tok_regex, arg2),
+ tok_str(arg2, tok_regex, arg1));
+}
+
val tok_where(val str, val tok_regex)
{
list_collect_decl (out, iter);