News for hackers. Stuff that matters.
Re:Functional Language Features in Rust – Iterators and Clos... by wahern on Tuesday March 07, 2017 @06:30PM (#13816283)
How would one explicitly allocate space for a closure? (That is, in such a way that one could handle allocation failure.) I can't find any examples nor any hints about what the syntax might look like.
Re:Functional Language Features in Rust – Iterators and Clos... by steveklabnik on Tuesday March 07, 2017 @06:35PM (#13816328)
Closures are stack allocated unless you wrap them in something like a Box, so it's up to you. They're no different than any other value.