Hi, Looking at the Rust documentation, I read: ---- Named functions, like those we've seen so far, may not refer to local variables decalared outside the function - they do not "close over their environment". For example you couldn't write the following:
let foo = 10; fn bar() -> int { ret foo; // `bar` cannot refer to `foo` } Rust also supports closures, functions that can access variables in the enclosing scope. ---- I can't help but asking why can't named function close over their environment? In the case above, I see no harm in allowing the 'bar' function to access 'foo'. David _______________________________________________ Rust-dev mailing list Rust-dev@mozilla.org https://mail.mozilla.org/listinfo/rust-dev