News for hackers. Stuff that matters.
Re:Rust 0.6 Released by drbawb on Wednesday April 03, 2013 @06:21PM (#5489643)
I was thinking you might have a function that operates on some fixed length vector.

For e.g: `fn foo(bar: ~[int, ..3]) { ... }`, and the compiler would enforce that you only pass vectors of length 3 to that function.

But since I can't get `~[int, ..3] = ~[1,2,3]` (etc.) to compile that seems to be impossible w/ vectors on the heap?

Re:Rust 0.6 Released by pcwalton on Wednesday April 03, 2013 @08:37PM (#5490230)
It's a bug. Sorry about that. For now, write the type as `~([int, ..3])`.
Re:Rust 0.6 Released by spicyj on Thursday April 04, 2013 @02:32AM (#5491303)
I stand corrected -- thanks, didn't realize that you could have a pointer to a fixed-length vector.
Re:Rust 0.6 Released by spicyj on Wednesday April 03, 2013 @06:23PM (#5489657)
I believe you can't do that. You can, however, make a function that only operates on 3-tuples:

fn foo(bar: (int, int, int)) { ... }