Anonymous user
Closures/Value capture: Difference between revisions
→{{header|C sharp|C#}}
m (→{{header|Sidef}}: modified code to work with Sidef 2.10) |
|||
Line 347:
64</lang>
=={{header|Ceylon}}==
<lang ceylon>shared void run() {
//create a list of closures with a list comprehension
value closures = [for(i in 0:10) () => i ^ 2];
for(i->closure in closures.indexed) {
print("closure number ``i`` returns: ``closure()``");
}
}</lang>
=={{header|CoffeeScript}}==
|