I've read the "whole array v. slice" argument with some
interest and I want to express an optinion based not on
pedantic details of the complex standard, but on the user's
perception of the language. Given an rank-one array A,
and two pointers P and Q:
P => A
Q => A(:)
If you decide that only P is associated with the whole of A
and that Q only points to a slice (even though a complete slice),
you place the purden of this overly subtile distinction on the
user.
I believe the user can understand that it makes no sense
to allow the deallocation of a partial object. That leaves
fragments around, and makes it confusing to determine
what parts still exist that can be used - not to mention the
difficulty of implementing such a memory manager.
But, to expect the user to understand that a pointer through
which all the array can be referenced is still not necessarily
a pointer to the "whole object" is just too subtile. I don't
think most programmers will get it, nor will they approve.
Nor do I think most implementations will maintain the distinction.
If a pointer to a contiguous object that matches the description
the memory manager has of an allocated region of memory is
passed in the DEALLOCATE statement, how would the memory
manager even tell whether the pointer was assigned as with P
above or as with Q? Are we to now require implementations
to carry additional information internally that expresses that
distinction, even though its only application is to confuse users?
--
J. Giles
"I conclude that there are two ways of constructing a software
design: One way is to make it so simple that there are obviously
no deficiencies and the other way is to make it so complicated
that there are no obvious deficiencies." -- C. A. R. Hoare
|