Rosetta Code:Village Pump/Arrays: Difference between revisions

on inexact translations
(State index range?)
(on inexact translations)
Line 1:
In RC, Array tasks are not very organized. Let's see: [[Array]], [[Creating an Array]], [[Array Initialization]], [[Collections]], and a lot of examples in [[Creating an Array]] (mostly dynamic languages like Python) aren't really using Arrays, they are using just Lists, Vectors and etc. Arrays are not dynamic. A solution is create a [[Creating a List]] or etc. But other languages call it in a different way. This is not really a solution.
 
:I don't think you can force a distinction between Dynamic and Static arrays. In many languages, it is common practice to use a particular construct in place of another common one. This makes logical sense to appear as the "correct" translation. For example, perl implements many higher-level concepts based on it's standard dynamic data structures, sometimes with special syntatic support. These clearly fit here even if underlying implementation is visible in the language. ----[[Special:Contributions/66.245.151.131|66.245.151.131]] 04:39, 13 August 2009 (UTC)
 
A real idea is merging [[Assigning Values to an Array]], [[Creating an Array]] and all Array related tasks in an single task. ([[Arrays]]), and creating another task for any "dynamic array" (Lists/Vectors/Sets) called [[Dynamic Arrays]], showing how to create and append values to it. There is a lot of confusion on array tasks in RC. This really need to be changed. --[[User:Guga360|Guga360]] 02:35, 30 July 2009 (UTC)
Line 18 ⟶ 19:
 
:Could you add to the task so that entries also state what the minimum index of an array is and whether or not this minimum index is changeable (and by what means). Some languages (Verilog and VHDL certainly), allow you to state the minimum and maximum index range in the variable definition and both or either may be zero negative or positive! --[[User:Paddy3118|Paddy3118]] 19:26, 30 July 2009 (UTC)
 
I wonder though whether this site is suitable for providing generic translations or patterns that might be applied in any language to create or emulate a missing construct. For example, implementing static arrays using hashes or strings. ----[[Special:Contributions/66.245.151.131|66.245.151.131]] 04:39, 13 August 2009 (UTC)
Anonymous user