Closures/Value capture: Difference between revisions

m (Correction to Lua to bring in line with task)
Line 926:
i = 5
p list[3][] #=> 25</lang>
 
=={{header|Rust}}==
<lang rust>fn main() {
let fs: ~[proc() -> uint] = range(0u,10).map(|i| {proc() i*i}).collect();
println!("7th val: {}", fs[7]());
}
</lang>
 
=={{header|Scheme}}==
Anonymous user