News for hackers. Stuff that matters.
Re:Rust 0.4 call for testing by masklinn on Thursday October 04, 2012 @05:46AM (#4611573)
Even more functional-ish features: most block-based constructs are actually parse transforms on top of HoFs. For instance

    for 5.times {
        // code
    }
desugars to:

    // |args*| { stmt* } is the Rust block syntax
    times(5, || {
        // code
        true // explicit order to continue
    })
Re:Rust 0.4 call for testing by asdfaoeu on Thursday October 04, 2012 @07:01AM (#4611728)
I somewhat wish they had used something like the ruby style for this to allow chaining of the blocks e.g.

    5.times{|x| x}.select{|x| x < 3}.collect{|x| x + 2}
Edit: Ok ignore that it seems they do have that (https://mail.mozilla.org/pipermail/rust-dev/2012-July/002000...) not sure of the difference, maybe just a result of the fast development.