summaryrefslogtreecommitdiff
path: root/lib/std/sljoin.myr
diff options
context:
space:
mode:
Diffstat (limited to 'lib/std/sljoin.myr')
-rw-r--r--lib/std/sljoin.myr15
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/std/sljoin.myr b/lib/std/sljoin.myr
new file mode 100644
index 0000000..f1fe58a
--- /dev/null
+++ b/lib/std/sljoin.myr
@@ -0,0 +1,15 @@
+use "alloc.use"
+use "slcp.use"
+
+pkg std =
+ generic sljoin : (dst : @a[:], src : @a[:] -> @a[:])
+;;
+
+generic sljoin = {dst, src
+ var len
+
+ len = dst.len
+ dst = slgrow(dst, len + src.len)
+ slcp(dst[len:], src)
+ -> dst
+}