ref: 137d0b96baa72f12a83e60f6b507f81a9a3bee4c
parent: ea7fb6cca6d0fbe0f4f3f3ef269d97e76c488c27
author: Ori Bernstein <[email protected]>
date: Thu Dec 12 11:44:40 EST 2013
Add missing slpush implementation.
--- /dev/null
+++ b/libstd/slpush.myr
@@ -1,0 +1,13 @@
+use "types.use"
+use "alloc.use"
+use "fmt.use"
+
+pkg std =
+ generic slpush : (sl : @a[:], elt : @a -> @a[:])
+;;
+
+generic slpush = {sl, elt
+ sl = slgrow(sl, sl.len + 1)
+ sl[sl.len - 1] = elt
+ -> sl
+}