Anonymous user
Closures/Value capture: Difference between revisions
→{{header|Ruby}}
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}}==
|