Re: list algebra
Date: Sat, 10 Jul 2004 23:08:42 +0100
Message-ID: <DBOONtFqjG8AFwaL_at_thewolery.demon.co.uk>
In message <7iAEc.3599$%_6.3586_at_attbi_s01>, Marshall Spight
<mspight_at_dnai.com> writes
>> I like it. A list by definition homogeneous.
>> The somewhat explosive differentiation is pushed to 'type'.
>>
>> It won't suit widely spread ideas on the
>> meaning of the term list, so it must be stated.
>>
>> http://www.swif.uniba.it/lei/foldop/foldoc.cgi?list
>> <quote>
>> A data structure holding many values, possibly of different types,
>> which is usually accessed sequentially, working from the head to
>> to the end of the tail - an "ordered list".
>> This contrasts with a (one-dimensional) array, any element
>> of which can be accessed equally quickly.
>> </quote>
>
>I've long thought those widely spread ideas are crap.
>
>The above definition describes two different implementations
>of list, and ignores the interface question entirely.
>"List" or "sequence" is a mathematical concept
>and it can be implemented in many different ways.
>(In java, this is essentially the difference between
>java.util.List, an interfact, and java.util.LinkedList,
>and java.util.ArrayList. The first is interface; the
>other two are different implementations of that interface.)
And as soon as you start talking MV, that definition is wrong, anyway. In MV, a "dynamic array" is usually accessed sequentially, working from the head to the end of the tail.
From the programmer's point of view, it is a normal array. From the program's point of view, it's a (funny kind of) list.
Cheers,
Wol
-- Anthony W. Youngman - wol at thewolery dot demon dot co dot uk HEX wondered how much he should tell the Wizards. He felt it would not be a good idea to burden them with too much input. Hex always thought of his reports as Lies-to-People. The Science of Discworld : (c) Terry Pratchett 1999Received on Sun Jul 11 2004 - 00:08:42 CEST