Jump to content

Rosetta Code:Village Pump/Arrays: Difference between revisions

"Danger, Will Robinson!"
(I like the flexibility :-))
("Danger, Will Robinson!")
Line 7:
 
:::I prefer that we set tasks that allow some flexibility in how they are accomplished w.r.t. language datatypes. What if a languages array type were dynamic in that it could automatically grow in length to accommodate any index, but always used a computed offset into contiguous memory for indexing? What if an array could use two or more regions of memory and the array indexing take account of the fact that, for example, different ranges of indices might be in separate memory blocks? It shouldn't matter too much, unless the task is, (like in the number of sort tasks), ''how'' memory is used in the array, rather than a data-structure that is accessed roughly in a certain way. Conversely. If a task were to interface to a C function that took a pointer to a C array as an argument, then the language would have to make sure to send a pointer to a contiguous region of memory set with appropriate values - but the language in normal use may not use such 'arrays' except for interfacing to C. Why punish the language in this case? --[[User:Paddy3118|Paddy3118]] 04:43, 30 July 2009 (UTC)
 
I advise being very careful. The problem is that language terminology varies wildly and permitted operations is, if anything, even more differentiated across the languages. What is an obvious merger for one might be a loss of an important subtlety for another. (It was the “aren't really using Arrays” that triggered this message, as it indicated that the author of it might be projecting how one language does things onto others, which is usually a mistake.) —[[User:Dkf|Donal Fellows]] 09:56, 30 July 2009 (UTC)
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.