Closures/Value capture: Difference between revisions
Content deleted Content added
→{{header|Factor}}: "Forget the variable!" Add a version that uses fried quotations. |
→{{header|Common Lisp}}: Add 3 sentences to describe this code. |
||
Line 163:
64</lang>
The ''loop'' mutates its binding ''i''. The purpose of <code>(let ((i i)) ...)</code> is to create a different binding ''i'' for each ''lambda'' to capture. Otherwise, all 10 lambdas would capture the same binding and return 100.
=={{header|D}}==
|