Talk:Apply a callback to an array: Difference between revisions

From Rosetta Code
Content added Content deleted
(Responses)
(array vs list)
Line 2: Line 2:


:I wrote up some [[Help:Common Issues|guidelines]], but I need to make them more visible. I'll probably add them to--or link to them from--the programming task template.--[[User:Short Circuit|Short Circuit]] 12:46, 23 January 2007 (EST)
:I wrote up some [[Help:Common Issues|guidelines]], but I need to make them more visible. I'll probably add them to--or link to them from--the programming task template.--[[User:Short Circuit|Short Circuit]] 12:46, 23 January 2007 (EST)

== array vs list ==

I was just looking at the [[Haskell]] solution for this task, and it uses a list instead of an array. Of course, Haskell has built in arrays, lists are just more natural, as they are in all functional languages. This seems deceptive to me. I know lists are more natural than arrays in Haskell, but it seems to me this page should contain the array example, and an alternate task should be made for lists. Just as Haskell will seem more complicated on the array examples, imperative languages like [[C]] will have to use a complicated list structure for the list examples. It doesn't seem right to neglect this distinction. Thoughts? --[[User:Zarvok | Zarvok]] | [[User_talk:Zarvok|Talk]] 22:45, 23 January 2007 (EST)

Revision as of 03:45, 24 January 2007

The problem is, of course, that they're all doing slightly different things. To some extent this is unavoidable due to language differences, but when one example is mapping the results into another array and a different example decides to print them, that's just a bit sloppy. Though I certainly don't mind if you have secondary examples demonstrating different techniques or modifications to the basic premise (such as the c++ use of a binary function).

I wrote up some guidelines, but I need to make them more visible. I'll probably add them to--or link to them from--the programming task template.--Short Circuit 12:46, 23 January 2007 (EST)

array vs list

I was just looking at the Haskell solution for this task, and it uses a list instead of an array. Of course, Haskell has built in arrays, lists are just more natural, as they are in all functional languages. This seems deceptive to me. I know lists are more natural than arrays in Haskell, but it seems to me this page should contain the array example, and an alternate task should be made for lists. Just as Haskell will seem more complicated on the array examples, imperative languages like C will have to use a complicated list structure for the list examples. It doesn't seem right to neglect this distinction. Thoughts? -- Zarvok | Talk 22:45, 23 January 2007 (EST)