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: bobduff@world.std.com (Robert A Duff) Subject: Re: Equality operator overloading in ADA 83 Date: 1997/04/23 Message-ID: #1/1 X-Deja-AN: 236864358 References: <01bc4e9b$ac0e7fa0$72041dc2@lightning> <335E0B1F.12C9@elca-matrix.ch> Organization: The World Public Access UNIX, Brookline, MA Newsgroups: comp.lang.ada Date: 1997-04-23T00:00:00+00:00 List-Id: In article <335E0B1F.12C9@elca-matrix.ch>, Mats Weber wrote: >> 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%. I think I agree that "=" should compose, in the sense that composite types call the user-defined "=" of their components, and the predefined "=" doesn't "re-emerge" in generics. But how far do you think we should carry this? E.g. if "=" is redefined for a scalar type, does that affect case statements on that type? After all, case stms check the case expression for equality with some values. What about operators other than "="? If "/" is redefined for an integer type, should Text_IO.Integer_IO know about it? It might well make Put(some-integer) do the "wrong" thing, since the generic might need to divide by 10. If I redefine "<" on a scalar type, should "<" on an array-of-that-type call it? - Bob