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=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID 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: mheaney@ni.net (Matthew Heaney) Subject: Re: Equality operator overloading in ADA 83 Date: 1997/04/29 Message-ID: #1/1 X-Deja-AN: 238317608 References: <01bc4e9b$ac0e7fa0$72041dc2@lightning> <335F5971.6375@elca-matrix.ch> <3365D08F.26EA@elca-matrix.ch> Organization: Estormza Software Newsgroups: comp.lang.ada Date: 1997-04-29T00:00:00+00:00 List-Id: In article , bobduff@world.std.com (Robert A Duff) wrote: >In retrospect, I tend to agree that we should have gone a wee bit >further in composability of "=". Especially since "=" on nonlimited >types is a new feature (except for the Goodenough trick, which is silly >to worry about). And because "=" is already special anyway -- the magic >"/=" you get for free, the fact that dispatching calls to "=" do a >different sort of tag check, etc. > >However, I'm not quite sure how far we should have gone. Not very. >Certainly not to extending composability to other operators, and >certainly not affecting the semantics of "in" or "case". Perhaps I'd >consider such things for a new language, but not for Ada 9X. Yes, I agree; that about sums it up nicely. I feel that the language should have guaranteed that equality composes, when redefined for nonlimited, untagged types. I'm not passionate about other operators (how many times do you have "<" for records?). Even if a user redefines equality, he should implement it so that the behavior is identical to predefined equality. It's not any different when overriding a primitive operation inherited from a (tagged) parent: it's the same operation, but with a different implementation. I'm not going to maliciously override an Area function to return Circumference instead. And I'm not going to override equality to return anything other than equality; the behavior will be the same. So why not let equality compose? Perhaps we can repair this...um..."feature" of the language in Ada 0X. :-) Matt -------------------------------------------------------------------- Matthew Heaney Software Development Consultant (818) 985-1271