summaryrefslogtreecommitdiff
path: root/libstd/slfill.myr
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2014-01-06 22:18:25 -0500
committerOri Bernstein <ori@eigenstate.org>2014-01-06 22:18:25 -0500
commit5c1af81cfb80a3a4dcdb9b4cd8f1597366a0233c (patch)
tree6552fa1ec51847ba1f38311bbe5bdf7328018126 /libstd/slfill.myr
parent72a6efce6e4619af93bea66fdfd1916ebe2d6af1 (diff)
downloadmc-5c1af81cfb80a3a4dcdb9b4cd8f1597366a0233c.tar.gz
Make the code match the comment.
Diffstat (limited to 'libstd/slfill.myr')
-rw-r--r--libstd/slfill.myr12
1 files changed, 12 insertions, 0 deletions
diff --git a/libstd/slfill.myr b/libstd/slfill.myr
new file mode 100644
index 0000000..d90e8f5
--- /dev/null
+++ b/libstd/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
+}