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/26 Message-ID: #1/1 X-Deja-AN: 237557974 References: <01bc4e9b$ac0e7fa0$72041dc2@lightning> <5jsfdm$e50@mulga.cs.mu.OZ.AU> Organization: The World Public Access UNIX, Brookline, MA Newsgroups: comp.lang.ada Date: 1997-04-26T00:00:00+00:00 List-Id: In article <5jsfdm$e50@mulga.cs.mu.OZ.AU>, Fergus Henderson wrote: > >dewar@merv.cs.nyu.edu (Robert Dewar) writes: > >>Actually it is not entirely semantially neutral, there is a problem with >>exceptions, in that in the shared model there is only one, and in the >>unshared case there are multiple exceptions -- the current Ada 95 solution >>in this area is not very appetizing, and also causes portability difficulties. Robert, unless I'm confused about what you're talking about, I think you're remembering an earlier version of Ada 9X. Ada 95 is the same as Ada 83 in this regard. In Ada 83, if you declare an exception in a generic, then each instance of that generic has its own copy of that exception. This follows from the fact that generic instantiation is defined as a textual copy, with some exceptions (the main exception being that name resolution is not "redone" on the instance). There was a version of Ada 9X that proposed to change this rule, by saying it is OK if the compiler wants to view them all as the same exception. This would simplify code-sharing. However, this language change was rejected by reviewers, primarily on the basis of upward compatibility concerns. I believe this proposed change was restricted to exceptions declared in the generic body, and it's not easy to write a test case that can tell the difference, so I'm not sure those upward compatibility concerns were sensible. So Ada 95 retains the Ada 83 rule. If you share code for instances, you have to make it look like each exception has its own identity. >What do you mean when you say there are multiple exceptions in the unshared >case? Could someone please elaborate, and/or give a pointer to the >appropriate part of the RM? - Bob