NICE-ESG-Libs Digest        Mon, 26 Feb 96       Volume 2 : Issue  21 

Today's Topics:
                         Class ARRAY proposal


NICE Eiffel Standards Group -- Library Committee Mailing List To post to list: NICE-ESG-Libs@atlanta.twr.com To send mail to the Chairman of the committee: NICE-ESG-Libs-chair@atlanta.twr.com Administrative matters (sign up, unsubscribe, mail problems, etc): NICE-ESG-Libs-request@atlanta.twr.com
Date: Mon, 26 Feb 1996 18:10:25 -0800 (PST) From: ericb@eiffel.com (Eric Bezault) Subject: Class ARRAY proposal To: NICE-ESG-Libs@atlanta.twr.com (NICE ESG LIBS) Dear Library Committee members, As the new delegate for ISE to the NICE Library Committee, I reviewed once again Jim McKim's proposal for class ARRAY and noticed some minor problems. Here they are: o The precondition of feature `size' says: valid_indices: min_index <= max_index which prevents us from "sizing" to an empty array. Since it is allowed to create an empty array, I suggest that it should also be possible to size it to empty as well. So I propose the following precondition in replacement to the former one: valid_indices: min_index <= max_index + 1 Note that it is the same as in `make'. [After a private discussion, Jim was concerned about the contract (especially the precondition) of feature `accommodate' as well. But I think the specification of `accommodate' is semantically correct and doesn't need to be changed.] o The following precondition type_identity: same_type (other) from GENERAL is missing in `copy'. Jim told me that it was not intentional. So I propose this precondition to be added to feature `copy'. o In the RB-3 amendment (and also in the original proposal and Bertrand's suggestion), one can read as one of the postconditions of `is_equal': definition: -- Result = (lower = other.lower) and (upper = other.upper) and for_all i, lower..upper (item (i) = other.item (i)) However the check for item equality is not valid when the bounds are not the same. In my view, that postcondition should be: definition: -- Result = (lower = other.lower) and (upper = other.upper) and then for_all i, lower..upper (item (i) = other.item (i)) Note the "and then" instead of "and" before "for_all". o And last (but not least), since there is no agreement yet for what the signature of `to_c' (or `to_pointer') should be, I suggest that it would be removed from the standard. First, there is no reason to put something which is not standard in the Standard. It had been agreed at the time of ELKS '95 announcement that `to_c' should not be part of the Standard for the same reason (See NICE-ESG-Libs Digest V1 #230, V1 #231, V1 #232 and v1 #241). Also, I don't think Jim's proposal can be adopted as-is as the standard if one can read: to_c: POINTER -- Address of actual sequence of values, -- for passing to external (non-Eiffel) routines. CONCERN: ISE would like the type of this feature be ANY. Again, the current proposal takes no stand on this issue. My concern here is the same as the one about `resize' which had two interpretations (now split in two routines `size' and `accommodate') or `make_from_array' whose header comment is ambiguous. I already notified our unofficial "Amiable Array Advocate" (Jim wants to be called AAA ;-) about the above remarks and if Christine asked me to do so I will propose amendments for them. PS. Have a look at the Web page I'm putting together. Comments are welcome. http://eiffel.com/private/nice/library Best regards, -- Eric Bezault Interactive Software Engineering Inc. 270 Storke Road, Suite #7 / Tel +1 (805) 685-1006 \ Goleta, California 93117, USA \ Fax +1 (805) 685-6869 /