From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,c3a7c1845ec5caf9 X-Google-Attributes: gid103376,public From: Mats Weber Subject: Re: Equality operator overloading in ADA 83 Date: 1997/04/29 Message-ID: <3365BC3E.54C5@elca-matrix.ch>#1/1 X-Deja-AN: 238139149 References: <01bc4e9b$ac0e7fa0$72041dc2@lightning> <335CAEFE.35DC@elca-matrix.ch> <335E0B1F.12C9@elca-matrix.ch> Organization: ELCA Matrix SA Reply-To: Mats.Weber@elca-matrix.ch Newsgroups: comp.lang.ada Date: 1997-04-29T00:00:00+00:00 List-Id: Robert Dewar wrote: > > Mats Weber said > > <<> Composability should always be guaranteed by user-defined types, too. > > There seems to be much disagreement on this question for all kinds of > reasons. But I agree with you 100%.>> > > It is helpful if you make clear whether you are making a pronouncement about > the original Ada 83 design or the decision not to introduce upwards > incompatibilities in the Ada 95 redesign (I trust you are NOT making a > statement about Ada 95 implementations :-) My pronouncement is about Ada 95; Ada 83 was "clean" with respect to equality because of the strict rules on its redefinition (if we don't count the unexpected possibility of redefining it for non-limited types) and the fact that it does not automatically compose when some component is of a limited type. My view is that if you allow redefinition of "=", then you must make sure it behaves (composes, does not reemerge) correctly, which was not done in Ada 95 except for tagged types. I also think that the upward incompatibilities that the non-reemergence of predefined operations would have introduced are minimal compared to how a programmer is betrayed when he writes type T is private; function "=" (L, R : T) return Boolean; and the predefined "=" reemerges in some places with an unknown effect since the type is private.