3 ms·
> Wouldn't it have been a better approach to add some sort of demarkation, such as i* or i^ (or whatever) to indicate this? That's the path C++ took[0], the Ru
by masklinn 11y ago
> Wouldn't it have been a better approach to add some sort of demarkation, such as i* or i^ (or whatever) to indicate this?
That's the path C++ took[0], the Rust people thought it had too much syntactic and semantic overhead, and that having just "move" and "referring" closures would be much simpler. If you want to mix them up, it's easy enough to create references outside the closure (and capture them by value with a move closure)
[0] http://en.cppreference.com/w/cpp/language/lambda#Lambda_capture http://en.cppreference.com/w/cpp/language/lambda#Lambda_capt...
- steveklabnik 11y agoThere was a really good thread on this on /r/urust: https://www.reddit.com/r/rust/comments/46w4g4/what_is_rusts_lambda_syntax_and_design_rationale/ https://www.reddit.com/r/rust/comments/46w4g4/what_is_rusts_... In particular, don't miss this post: https://www.reddit.com/r/rust/comments/46w4g4/what_is_rusts_lambda_syntax_and_design_rationale/d08hee0 https://www.reddit.com/r/rust/comments/46w4g4/what_is_rusts_...