ref: 9e933c756a0e0653d347afac3905e75dd8df1c28
parent: ed2c14dc7a8873d3dd4504c74feb3a4f0434758e
author: Ori Bernstein <[email protected]>
date: Thu Aug 15 17:39:36 EDT 2013
Add sljoin function
--- a/libstd/Makefile
+++ b/libstd/Makefile
@@ -13,6 +13,7 @@
slappend.myr \
slcp.myr \
sleq.myr \
+ sljoin.myr \
slurp.myr \
strcmp.myr \
sys.myr \
--- /dev/null
+++ b/libstd/sljoin.myr
@@ -1,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
+}