[rust-dev] Vectors, mutability & vec::dedup

2012-12-13 Thread Tom Lee
Hey folks, So turns out I'm still struggling with types a little. This time it's related to mutability & function signatures. Apologies in advance if I screw up terminology. Take the following code, which prints out the unique elements of a vector: extern mod std; use std; fn main() { let mut

Re: [rust-dev] Fall-through in alt, break&continue by label

2012-12-13 Thread Henri Sivonen
On Fri, Nov 16, 2012 at 2:34 AM, Brian Anderson wrote: > Tim got labeled break and continue work for 'loop', and I believe for > 'while' as well. It does not yet work on 'for' loops. Here's a test case to > crib off of: > > https://github.com/mozilla/rust/blob/incoming/src/test/run-pass/issue-2216

Re: [rust-dev] Vectors, mutability & vec::dedup

2012-12-13 Thread Patrick Walton
On 12/13/12 12:17 AM, Tom Lee wrote: It looks like the 'move' operations here are directly modifying the contents of the vector by moving data around in the vector. This strikes me as kind of strange. I've allocated an immutable vector on the exchange stack and so make the assumption that the con

Re: [rust-dev] Vectors, mutability & vec::dedup

2012-12-13 Thread Graydon Hoare
On 12-12-13 12:17 AM, Tom Lee wrote: > It looks like the 'move' operations here are directly modifying the > contents of the vector by moving data around in the vector. This > strikes me as kind of strange. I've allocated an immutable vector on > the exchange stack and so make the assumption that

Re: [rust-dev] Fall-through in alt, break&continue by label

2012-12-13 Thread Tim Chevalier
On Thu, Dec 13, 2012 at 7:03 AM, Henri Sivonen wrote: > On Fri, Nov 16, 2012 at 2:34 AM, Brian Anderson wrote: >> Tim got labeled break and continue work for 'loop', and I believe for >> 'while' as well. It does not yet work on 'for' loops. Here's a test case to >> crib off of: >> >> https://gith