summaryrefslogtreecommitdiff
path: root/lib/std/slfill.myr
diff options
context:
space:
mode:
Diffstat (limited to 'lib/std/slfill.myr')
-rw-r--r--lib/std/slfill.myr12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/std/slfill.myr b/lib/std/slfill.myr
new file mode 100644
index 0000000..d90e8f5
--- /dev/null
+++ b/lib/std/slfill.myr
@@ -0,0 +1,12 @@
+pkg std =
+ generic slfill : (sl : @a[:], v : @a -> @a[:])
+;;
+
+generic slfill = {sl, v
+ var i
+
+ for i = 0; i < sl.len; i++
+ sl[i] = v
+ ;;
+ -> sl
+}