[rust-dev] Swapping elements in a vec
marijnh at gmail.com
Sun Feb 27 23:44:14 PST 2011
> We'll probably wind up with a 'swap'
> primitive at some point down the line when unique ownership and move
> semantics are more thoroughly worked out.
This would be a great use case for syntactic extensions. Seems neater
to do something like this in the standard library than in the core.
(Context: Common Lisp's rotatef is a generalization of swap
implemented simply as a macro.
More information about the Rust-dev