From: Dick Hendrickson <[log in to unmask]> Wrote:
> [...] Unfortunately, there are no
>fortunate choices. Suppose P1 and P2 are pointers, what should happen
>to ASSOCIATED(P1,P2) for
> P1 => array(10:9) ; P2 => array(10:8)
>or
> P1 => array(10:9) ; P2 => array(5:4)
>or
> P1 => array(1:2:-1); P2 => array(2:1)
>or
> P1 => array(2:1) ; P2 => other_array(2:1)
>or suppose "other_array" is actually a pointer and points to array.
>
>The list of dumb things people can do with zero sized arrays is
>unfortunately non-zero sized.
>
>For what it's worth, I don't like the choice either. In fact at
>one X3J3 meeting I had a paper that "proved" TRUE was the best
>result as the size of the arrays approached zero.
It may be worse that you think. It's just possible that what people
want in this instance is to be able to point to an interesting place
within an array without allowing any refernces through the pointer.
They simply want a place holder. So:
P1 => array(10:9) ; P2 => array(10:8)
Maybe they want ASSOCIATED(P1, P2) to be true here, but not
for:
P1 => array(10:9); P2 => array(5:4)
(Here I'm guessing that the initial "element" of the empty referent
is what would determine whether the pointers were the same or
not.)
I can see how this might be vaguely useful, but what a mess it makes
of the language. I'm just curious why pointers to zero-sized objects
is allowed at all. Is there a value I'm not seeing?
--
J. Giles
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|