NICE-ESG-Libs Digest Wed, 13 Sep 95 Volume 1 : Issue 290 Today's Topics: valid_index
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: Wed, 13 Sep 1995 08:40:01 GMT From: Roger Browne <rogerb@eiffel.demon.co.uk> Subject: valid_index To: NICE-ESG-Libs@atlanta.twr.com Bertrand Meyer wrote: > Just a point of cosmetics. I saw somewhere a proposal to include a > function `valid_index' to ARRAY. My copy of the Eiffel Library Standard, Vintage 95 already shows a function 'valid_index(i: INTEGER): BOOLEAN' in class ARRAY, which is used in the precondition for features like 'item'. There is also a function 'valid_index' in the ELS95 class STRING. > ... if such a function or its equivalents elsewhere were to be adopted I think > we should use names such as `correct_index'. ETL is quite strict in > using the word ``valid'' to denote adherence to static semantic > rules (``validity constraints''), as opposed to ``correct'' which applies > to dynamic semantics (e.g. adherence to assertions). To me, 'correct' has overtones of program correctness in the broader sense (freedom from bugs). An index may satisfy a precondition yet may contain an incorrect value. If a change is needed, may I suggest 'index_in_range'? Regards, Roger -- -- Roger Browne, 6 Bambers Walk, Wesham, PR4 3DG, UK | Ph 01772-687525 -- Everything Eiffel: compilers/libraries/publications | +44-1772-687525
|