Most of the time that I've seen return value lifetimes specified, they
aren't returning something of the same type as a parameter. For
instance, the vec module has "fn head<'r, T>(v: &'r [T]) -> &'r T". How
common is it for functions to actually return something of the same
type, as opposed to a ty
On Wed, Apr 10, 2013 at 05:25:53PM -0700, Erick Tryzelaar wrote:
> Great! We've needed something like this. I worry a little bit about the
> function declaration style though. I could see it being difficult to
> implement this format in the pretty printer, which would make it hard to
> write someth
On Tue, Apr 09, 2013 at 10:07:36PM -0400, Ashish Myles wrote:
> Hi,
>
> I am running the rust compiler from trunk. My macro usage seems to be a
>
>
> macro_rules! my_print(
> ($a:expr, $b:expr) => (
> io::println(fmt!("%d", a));
> io::println(fmt!("%d", b));
> );
> )
On Mon, Apr 01, 2013 at 08:44:28PM +0100, Alex Bradbury wrote:
> On 1 April 2013 19:21, Graydon Hoare wrote:
> > I don't know what's going on in your case. When I run this exercise on
> > my machine I get the following:
> >
> > 1.5 MiB + 720.0 KiB = 2.2 MiB hello (5)
> >
> > which looks
On Tue, Mar 12, 2013 at 12:44:55PM -0700, Graydon Hoare wrote:
> unsafe mut x : T = v; // more random choices...
"unsafe mut" doesn't really make sense, since defining a global isn't
unsafe, just using it is. What about just "mut x"?
const x : T = v;
mut y : T = v;
-doy
___