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.8 required=5.0 tests=BAYES_00,INVALID_DATE autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,4c86cf2332cbe682 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 1995-01-19 09:53:15 PST Path: nntp.gmd.de!newsserver.jvnc.net!nntpserver.pppl.gov!princeton!udel!gatech!howland.reston.ans.net!news.sprintlink.net!pipex!sunic!news.uni-c.dk!nbivax.nbi.dk!meyer.fys.ku.dk!sparre Newsgroups: comp.lang.ada Subject: Re: Ada.strings.bounded problems? Message-ID: <1995Jan19.185316.2225@nbivax.nbi.dk> From: sparre@meyer.fys.ku.dk (Jacob Sparre Andersen) Date: 19 Jan 95 18:53:15 +0100 References: Nntp-Posting-Host: meyer.fys.ku.dk X-Newsreader: TIN [version 1.2 PL2]Lines: 38 Date: 1995-01-19T18:53:15+01:00 List-Id: Keith Thompson (kst@alsys.com) wrote: [ Mats.Weber@matrix.ch and ncohen@watson.ibm.com wrote about problems with implementing Bounded_String. ] |^^^^^^^^^^ | In Ada 95, it's very easy to have a case like the above where the | user-defined "=" operator for a subcomponent is bypassed. Section II-6.3 | of the Rationale, which discusses overloading of "=" and "/=", doesn't | mention this problem. Quite possibly it was simply overlooked. | | It's obviously too late to fix this in the language by requiring | predefined "=" to invoke user-defined "=" for subcomponents. | | I suggest that Ada 95 compilers should issue a warning for a type | whose predefined "=" operator bypasses a user-defined "=" operator | for a subcomponent. Determining exactly when to issue such a warning | may be difficult ("=" can be declared to return a type other than | Standard.Boolean, the left and right operands can be different types, | "=" and "/=" can be overloaded separately in some circumstances, the | declaration for "=" needn't be in the same scope as the operand type(s), | etc.), but catching the most common cases shouldn't be difficult. |__________ I agree with KT's suggestion about compiler warnings. Is it allready time to start writing down what to do with Ada0X? Is somebody making a (mental) note of this problem for the '0X team, and where should such comments be sent? Regards, Jacob Sparre Andersen -- A good movie? - What about three? - Kieslowskis 'White', 'Blue' and 'Red'! -- URL's: "mailto:sparre@nbi.dk", "http://meyer.fys.ku.dk/~sparre", "mailto:sparre+@pitt.edu" & "http://www.pitt.edu/~sparre". -- "We need a plan to diverge from", Fesser