Talk:Loop over multiple arrays simultaneously: Difference between revisions

Content added Content deleted
(Add very ugly code for UNIX Shell.)
Line 4: Line 4:
It might help readers compare the languages more easily, if the task be clarified to either specify that the code should handle arrays of different types, or that all arrays are the same type. --[[User:Tikkanz|Tikkanz]] 00:21, 19 November 2009 (UTC)
It might help readers compare the languages more easily, if the task be clarified to either specify that the code should handle arrays of different types, or that all arrays are the same type. --[[User:Tikkanz|Tikkanz]] 00:21, 19 November 2009 (UTC)


:True, bit which to choose? --[[User:Paddy3118|Paddy3118]] 03:27, 19 November 2009 (UTC)
:True, but which to choose? --[[User:Paddy3118|Paddy3118]] 03:27, 19 November 2009 (UTC)
: I would suggest making a "same type" a primary goal for languages where it's convenient, and a second, separate "generic" example a secondary goal, and note which example goes with which goal. This keeps it simple for languages which support strong typing, allowing a little more showing off for languages with generics, and doesn't add a nonsensical requirement for languages with weak typing. --[[User:Short Circuit|Michael Mol]] 06:58, 19 November 2009 (UTC)
: I would suggest making a "same type" a primary goal for languages where it's convenient, and a second, separate "generic" example a secondary goal, and note which example goes with which goal. This keeps it simple for languages which support strong typing, allowing a little more showing off for languages with generics, and doesn't add a nonsensical requirement for languages with weak typing. --[[User:Short Circuit|Michael Mol]] 06:58, 19 November 2009 (UTC)
:For some languages, type declarations just aren't present (either because of type inference or because of the use of value systems which make it unnecessary). More importantly, '''''that's not the point of this task'''''. It's the looping construct that is significant, not the types of the data participating. (Well, assuming that the language can loop over arrays/lists of arbitrary element type; I can't think why anyone would restrict it, but someone somewhere might be silly enough.) –[[User:Dkf|Donal Fellows]] 09:09, 19 November 2009 (UTC)
:For some languages, type declarations just aren't present (either because of type inference or because of the use of value systems which make it unnecessary). More importantly, '''''that's not the point of this task'''''. It's the looping construct that is significant, not the types of the data participating. (Well, assuming that the language can loop over arrays/lists of arbitrary element type; I can't think why anyone would restrict it, but someone somewhere might be silly enough.) –[[User:Dkf|Donal Fellows]] 09:09, 19 November 2009 (UTC)