ref: 7258536522dff99b77080fdc5a06a2a299b8ecdd
parent: 014b76121ce587c0197eb02e9b9b13db998a3968
author: Ori Bernstein <[email protected]>
date: Sun Jul 20 15:25:24 EDT 2014
Add 'swap' to libstd
--- a/libstd/Makefile
+++ b/libstd/Makefile
@@ -43,6 +43,7 @@
strjoin.myr \
strsplit.myr \
strstrip.myr \
+ swap.myr \
sys.myr \
try.myr \
types.myr \
--- /dev/null
+++ b/libstd/swap.myr
@@ -1,0 +1,11 @@
+pkg std =
+ generic swap : (a : @a#, b : @a# -> void)
+;;
+
+generic swap = {a : @a#, b : @a#
+ var t
+
+ t = a#
+ a# = b#
+ b# = t
+}