[rust-dev] Closure Capture

Suminda Dharmasena sirinath at sakrio.com
Wed Jun 4 07:58:18 PDT 2014


Hi,

The Box is a welcome change over ~.

Any way the closure syntax can improve. Instead of having 2 syntaxes be
explicit of what is captured.

let x = 3;

fn  fun_arg       (arg: int) -> () { println!("{}", arg + x) }  //
cannot capturelet closure_arg = (arg: int)|x| -> () { println!("{}",
arg + x) }; // x is explicitly captured


Suminda
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/rust-dev/attachments/20140604/f0c4701d/attachment.html>


More information about the Rust-dev mailing list