Re: Array comparison

From: Maarten Wiltink (maarten_at_kittensandcats.net)
Date: 10/07/04


Date: Thu, 7 Oct 2004 16:55:40 +0200


"Skybuck Flying" <nospam@hotmail.com> wrote in message
news:ck3ael$177$1@news4.zwoll1.ov.home.nl...

>> I never said it was a technical difficulty in comparing arrays; I
>> stated that it was plain easy to write your own compare methods. My
>> point was that I see reason in it NOT being allowed, due to confusion
>> about which types can and can not be compared.
>
> There is no confusion about that since delphi already defines which
> things can be compared and which things can't be compared ;)

Now there's a good point. (-:

While array comparison is currently disallowed, it would (probably)
be easy to change that for the people who did, and the exact algorithm
is intuitive and obvious. As Skybuck said: require named types, check
array length for dynamic arrays, and recursively apply the existing
rules - checking for aliases would be useful but strictly it's just
an optimisation.

There is one interesting case that is unfortunately excluded by the
named-types rule: one static and one dynamic array with index types,
element types, length, and elements that all match. It would be neat
to find those "equal".

(Oh, and Skybuck? Nice going. You've written an unusually mature and
coherent message, and I appreciate it.)

Groetjes,
Maarten Wiltink