<br>On 19 August 2010 20:53, Janson, Adrian A &lt;<a href="mailto:janson.adrian.a@edumail.vic.gov.au">janson.adrian.a@edumail.vic.gov.au</a>&gt; wrote:<br>&gt; A one dimensional (or 1D) array is a data structure in which variables are grouped together under the same name...<br>
<br>I see a couple of problems with this definition.  First, an array can group together things which are not variables, i.e. literals, e.g. in Python:<br><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&gt;&gt;&gt; foo = [1, 1, 2, 3, 5, 8, 13, 21]</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">&gt;&gt;&gt; bar = [&quot;no&quot;, &quot;variables&quot;, &quot;here!&quot;]</span><br style="font-family: courier new,monospace;"><br>Second, an array is an array even if it doesn&#39;t have a name, e.g. in Python:<br>
<br><span style="font-family: courier new,monospace;">&gt;&gt;&gt; my_function([&quot;I&quot;, &quot;don&#39;t&quot;, &quot;have&quot;, &quot;a&quot;, &quot;name&quot;])</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">&gt;&gt;&gt; [&quot;indexing&quot;, &quot;a&quot;, &quot;literal&quot;, &quot;array&quot;][2]</span><br><br>&gt; A record is a structure that can be used to group together variables for a particular purpose.<br>
<br>This definitions shares the first problem above, but it also brings in something extraneous: &quot;for a particular purpose&quot;.  Surely any data structure serves some particular purpose intended for it by a programmer.<br>
<br>&gt; Indexing the elements of a record is often done via an identifier which is declared at the same time as the record.<br><br>This is true when the record is implemented as an associative array, but not when it is represented as a tuple.  E.g. in Python:<br>
<br><span style="font-family: courier new,monospace;">&gt;&gt;&gt; array_of_tuples = [(1441412050, &#39;Alice in Wonderland&#39;, &#39;Lewis Carroll&#39;),<br>...     (</span><span style="font-family: courier new,monospace;">1441412341, &#39;Through the Looking Glass&#39;, </span><span style="font-family: courier new,monospace;">&#39;Lewis Carroll&#39;)]<br>
&gt;&gt;&gt; print array_of_tuples[1][2]<br>Lewis Carroll<br><br></span>Here we accessed an element of a record using an integer.  But you&#39;re probably ok here since you said &quot;often&quot;, and I agree with that.<br>
<br>-Steven Bird<br><br>