Dick Hendrickson wrote:
> Yeah, it's an unfortunate choice. 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.
> 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.
There is perhaps one consistent way to handle these (way too late,
of course): adopt the view that there is one and only one zero-sized
array. Maybe this is what Dick was "proving"; the result is consistent.
An anlogy might be with strings.
string_1(1:n) == string_1(1:n) is true for all n, 0 <= n <=
len(string_1).
string_1(1:0) == string_2(1:0) is true for all strings because both are
equal to the null string (there is only one null string).
By analogy (uh-oh), all pointers to empty arrays are pointing to
the same thing. ???o
Or looking at it another way: it is TRUE that all of the elements
pointed to by P1 and P2 are the same (in each of Dick's examples).
I spent a lot of time in the '80s convincing people not to treat
empty arrays and null strings as "special", particularly for the
intrinsic
functions, but obviously didn't get this one taken care of properly.
--
Walt Brainerd [log in to unmask]
Unicomp, Inc. +1-520-298-7212 298-7074 (fax)
7660 E. Broadway, Suite 308 888-330-6060
Tucson, AZ 85710 USA http://www.uni-comp.com
Associ
--
Walt Brainerd [log in to unmask]
Unicomp, Inc. +1-520-298-7212 298-7074 (fax)
7660 E. Broadway, Suite 308 888-330-6060
Tucson, AZ 85710 USA http://www.uni-comp.com
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|