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-21 10:57:46 PST Path: nntp.gmd.de!newsserver.jvnc.net!nntpserver.pppl.gov!princeton!udel!gatech!bloom-beacon.mit.edu!panix!cmcl2!thecourier.cims.nyu.edu!thecourier.cims.nyu.edu!nobody From: dewar@cs.nyu.edu (Robert Dewar) Newsgroups: comp.lang.ada Subject: Re: Ada.strings.bounded problems? Date: 21 Jan 1995 13:57:46 -0500 Organization: Courant Institute of Mathematical Sciences Message-ID: <3frlfa$rp2@gnat.cs.nyu.edu> References: <1995Jan19.185316.2225@nbivax.nbi.dk> <1995Jan20.120612@lglsun.epfl.ch> <3fomrv$7i9@disunms.epfl.ch> NNTP-Posting-Host: gnat.cs.nyu.edu Date: 1995-01-21T13:57:46-05:00 List-Id: Magnus may not like the fact that you can legitimately override equality for non-limited types in Ada 83, but you can, and it is well known how to do it. Upwards compatibility means that existing code must work, it does not mean that existing code that meets Magnus' criterion for what he thinks is OK must work! Also, as Norm points out, the incompatibility extends beyond the use of the Goodneough tecnnique for redefinition of equality. It's easy to get heated up over minor things in the environment of suitable heated statements, but in practice I think this is a fairly small issue. After all it is up to an Ada 95 programmer whether to take advantage of the new capability or not. It will often mean that the proper decision is to either make the type limited or tagged. It is important to realize the hit on shared generics. THe design of Ada 95 has been carefully done to preserve the practicality of using shared generics, as is currently done by at least two implementations. In particular, suppose we have a simple generic with some discrete types as arguments. It seems unfortunate (both in terms of implementation complexity, and in efficiency) to require all equality operations to be done with thunks. Note that in the case of tagged types, the comparison operations are complex in any case, and often dispatching, so it is not a significant additional burden (just always dispatch inside the shared generic). As is so often the case in language design, delicate compromises are the order of the day. THis is particularly true when upwards compatibility must be maintained. It is true that the upwards compatibility criterion can result in some compromises that one might prefer not to settle for (look after all at C and C++!) Some during the ADa 95 felt that we were not adventurous enough in being incompatible, and some thought we should have been much MORE compatible. I think that the middle path steered was about right. Note incidentally that the non-upwards compatibilities here are of the worst possible kind: old code compiles fine and executes giving wrong results.