Re: [rust-dev] Couple of Random Questions

2013-01-22 Thread Sami Nopanen
Thank you for the answers. 2. How to allocate a mutable managed vector dynamically? I can create an owned vector with: let a = vec::from_elem(..); I can create a managed vector with: let a = at_vec::from_elem(..); You cannot. Because the elements of a managed vector are stored inline

Re: [rust-dev] Couple of Random Questions

2013-01-22 Thread Sami Nopanen
And in both cases, the sizes would not be known until runtime, so they could not be represented as [type * cnt]. In both cases, growing the vector is of no importance. Oh, I think perhaps Niko overestimated what you were asking for. One can't create a _resizable_ @[], due to the managed

[rust-dev] Lifetime Questions

2013-01-22 Thread Sami Nopanen
Hi, I'm trying to get my head around lifetime parameters. I think I mostly get them, for the simple cases anyway, but there are couple of examples that are leaving me confused. Copied some of the example code here from http://smallcultfollowing.com/babysteps/blog/2012/12/30/lifetime-notation/:

[rust-dev] Couple of Random Questions

2013-01-16 Thread Sami Nopanen
Hi, Some random questions based on playing around with Rust for a few weeks. 1. Do mutable variant types allocated in stack always occupy a fixed space (the size of the largest possibly value) ? I guess it would have to be so, just wondering if there might be some other magic going on.