Talk:Closures/Value capture: Difference between revisions

m
m (Would this read better as?)
m (moved Talk:Closures/Variable capture to Talk:Closures/Value capture: Better describes the task)
 
(4 intermediate revisions by 3 users not shown)
Line 23:
: Okay by me too. --[[User:TimToady|TimToady]] 20:48, 21 July 2011 (UTC)
:: 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 24, and the second a() give 39? [[User:Markhobley|Markhobley]] 13:42, 22 July 2011 (UTC)
 
Would this read better as "Create a list of up to 10 simple functions (anonymous functions are encouraged), so that the function returns the square of its parametric position within the list."? [[User:Markhobley|Markhobley]] 13:52, 22 July 2011 (UTC)
Anonymous user