News for hackers. Stuff that matters.
Re:The Value in Go’s Simplicity by Gaelan on Saturday November 16, 2019 @07:29PM (#21555817)
Is Rust mainstream? If so, this code:

    numbers.iter().map(|n| { ... }).sum();
Compiles to a plain loop, with no allocation.
Re:The Value in Go’s Simplicity by steveklabnik on Saturday November 16, 2019 @08:52PM (#21556078)
(You want for_each not map, by the way)
Re:The Value in Go’s Simplicity by Gaelan on Sunday November 17, 2019 @01:15AM (#21556774)
Wait, why? AFIAK for_each doesn't return another iterator, and I'm calling sum afterward.
Re:The Value in Go’s Simplicity by steveklabnik on Sunday November 17, 2019 @08:59AM (#21557926)
.... hacker news cut off the “sum” part, and so I didn’t see it. On my phone it just happened to clip it exactly long enough that it was still valid syntax, wow. Anyway, sorry and my bad!