Generic swap: Difference between revisions

m
(added alternative implementation - for Arturo)
Line 352:
===In-place modification===
 
<lang rebol>swap: function [a,b]->.exportable @[b,a]
tmp: var b
let b var a
let a tmp
]
 
c: 1
Line 358 ⟶ 362:
print [c d]
 
[c,d]: swap 'c 'd
print [c d]</lang>
 
1,532

edits