Generic swap: Difference between revisions

 
Line 2,070:
 
=={{header|langur}}==
Langur does not have an option for using references (so far). The following is not directly applicable to the task, but valuesValues can be swapped using multi-variable assignment, including indexed values (for mutable variables).
 
{{works with|langur|0.10}}
<syntaxhighlight lang="langur">var .abc = [1, 2, 3]
var .def = [5, 6, 7]
Line 2,080 ⟶ 2,079:
writeln .abc
writeln .def</syntaxhighlight>
 
Prior to 0.10, you would use parentheses as follows.
 
<syntaxhighlight lang="langur">(.abc[3], .def[3]) = (.def[3], .abc[3])</syntaxhighlight>
 
{{out}}
885

edits