summaryrefslogtreecommitdiff
path: root/lib/std/swap.myr
diff options
context:
space:
mode:
Diffstat (limited to 'lib/std/swap.myr')
-rw-r--r--lib/std/swap.myr11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/std/swap.myr b/lib/std/swap.myr
new file mode 100644
index 0000000..e3923c9
--- /dev/null
+++ b/lib/std/swap.myr
@@ -0,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
+}