On Thursday, 9 July 2015 at 19:19:42 UTC, Walter Bright wrote:
On 7/9/2015 12:56 AM, deadalnix wrote:
Several of which actually use linked list for list and
probably shouldn't
provide random access.
Yes. Consider:
for (int i = 0; i < list.length; ++i)
sum += list[i];
If indexing was allowed on a list, this would seem like
perfectly reasonable code.
In many languages that is perfectly reasonable because list does
not equal linked list. Its almost as if a list is an abstract
concept and does not mean any one definite data structure, hmmm
who wuda thunk that...