4 ms·
As mentioned in the blog post, I'm hopeful that the awful |&mut:| and |&:| and |:| can be completely removed with greater inference capabilities. I'll be speaki
by kibwen 12y ago
As mentioned in the blog post, I'm hopeful that the awful |&mut:| and |&:| and |:| can be completely removed with greater inference capabilities. I'll be speaking with nmatsakis soon about exactly what needs to be done to make this a priority for 1.0. Likewise, the `move` keyword should be possible to infer in many cases (though I honestly don't mind it very much).
Finally, I'm actually not bothered about the type of a closure being written as `FnMut(blah)` instead of `|blah|`, because that syntax was always a bit line-noisy in type position anyway.
The bottom line is simply that closures in a low-level systems programming language present a daunting design challenge that is hard to appreciate until you've wrestled with the domain. There is no one-size-fits all here that does not result in compromises that make closures essentially useless for this niche. The best that we can do is reduce down to as few knobs as possible (Rust closures are still a bit less expressive than C++ lambdas) and lean on inference to have the compiler Do What I Mean.