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