Leandro Lucarella wrote: > A more general solution is supporting tuples in the language, then you can > do something like: > a, b = b, a;
That's a great feature. But even if it's available, I'd use swap, because: * I wouldn't have to mention each variable twice * It would use move-operations rather than copy operations Parallel assignment is still useful for other stuff, like traversing the fibonachi sequence with two variables :-) (a, b) <- (b, a + b); -- Michiel Helvensteijn