shithub: mc

Download patch

ref: ec0241536de591d2f0f75a84ed3ee71cad8c5aae
parent: 5e8a15598f1399a8b0a296dac2af139e1ba28e16
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
+}