Jump to content

Talk:Closures/Value capture: Difference between revisions

(→‎Proposed task tweak: maybe don't require either 0 or 1)
Line 24:
:: I went ahead and changed it. Also changed the index requirement to 1-based, because to me that feels more language-neutral somehow. --[[User:Ledrug|Ledrug]] 01:19, 22 July 2011 (UTC)
:::If you want it language neutral, then don't mandate either 0 or 1 based indexing. It doesn't really matter much for demonstrating the feature. What does seem to matter a bit more is that the square be the square of the index, whichever is chosen, and we now have solutions where f[7] == 64, which bugs me somehow. --[[User:TimToady|TimToady]] 14:39, 22 July 2011 (UTC)
::::Fair enough. --[[User:Ledrug|Ledrug]] 14:52, 22 July 2011 (UTC)
 
What happens if the list is as follows?: a(), b(), a(),
::Should the first a() give 1, b() give 4, and the second a() give 9? [[User:Markhobley|Markhobley]] 13:42, 22 July 2011 (UTC)
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.