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, MSGID_RANDY autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,8b8748382fcfacc1 X-Google-Attributes: gid103376,public From: Robert Dewar Subject: Re: friend classes in ada95 Date: 2000/04/16 Message-ID: <8dc8oi$kda$1@nnrp1.deja.com>#1/1 X-Deja-AN: 611805632 References: <38F6B617.34E216A7@emw.ericsson.se> <38F887AE.8CDA24E0@acm.org> X-Http-Proxy: 1.0 x30.deja.com:80 (Squid/1.1.22) for client 205.232.38.14 Organization: Deja.com - Before you buy. X-Article-Creation-Date: Sun Apr 16 11:38:59 2000 GMT X-MyDeja-Info: XMYDJUIDrobert_dewar Newsgroups: comp.lang.ada X-Http-User-Agent: Mozilla/4.61 [en] (OS/2; I) Date: 2000-04-16T00:00:00+00:00 List-Id: In article <38F887AE.8CDA24E0@acm.org>, jrcarter@acm.org wrote: > Stefan Folkesson wrote: > > > > In ADA95, is there a way to make the private part of one class > > accessable from another (see friend classes in C++)? > > From ARM N.6: > > Class. A class is a set of types that is closed under > derivation, which means that if a given type is in the class, > then all types derived from that type are also in the class. > The set of types of a class share common properties, such as > their primitive operations. Some interesting Ada history, probably not known to many readers of this list, since it's quite a while ago now :-) It's always a hard sell when you choose terminology that is arbitrarily different from the cultural norm. It is interesting to recall the big debate at the Salem meeting between Tucker Taft and Jean Ichibiah. Jean argued that Ada 95 would be far more accessible to the object oriented cognoscenti if it was willing to embrace the term class more enthusiastically, and he suggested that type x is tagged record .... be replaced by class type x is record .... The distinguished reviewers had previously voted overwhelmingly approving the idea that the term class should appear in the declaration, although there was somewhat less enthusiasm for the prefix notation (although of course it is quite consistent with the notation used for task types and protected types). Tucker argued strongly (one almost might say frantically :-) that this was a bad idea, since class meant something different in Ada 95. The national delegations at Salem were all a bit appalled by the ferocity of the argument on both sides, and in particular at what was clearly a huge amount of effort the design team had spent in preparing the counter argument. The vote was even, with several countries abstaining, including the US. The US abstention reflected substantial disagreement in the US delegation (I can't rememeber everyone's individual positions, and indeed it would not be appropriate for me to divulge them in any case, but I can say I strongly supported the use of the term CLASS in this context, and not suprisingly Tucker strongly opposed it). The US delegation decided in advance that it would support the winning side. When the vote was tied, I got up and said: "Since it would take a majority decision to undo a previous decision, this means that the motion (to change to using class) fails, and the US delegation therefore changes its vote to opposed." I knew perfectly well at the time that if I had instead said "I really think we cannot have an important issue like this left open with an even vote, I propose that we discuss this further and revote, that then most likely CLASS would have been approved." But I worried about the dynamics. For whatever reason it was clear that the Ada 95 design team was truly ferociously opposed (in fact it reminded me of Jean's opposition to the unanimous recommendation of the Ada 83 DR's for removing derived types from Ada 83). Jean's motion was rejected partly because he insisted on the prefix notation. Indeed the Japanese delegation voted against it solely on this basis, and I think if they had realized that tactically their negative vote would sink the whole proposal, they would have reconsidered. Even if they had abstained, then the motion would have carried (by a majority of 2 countries, since the US would then have voted FOR the motion.) I tried before the discussion to get Jean to separate the two points, but he refused. I knew that was a tactical error, based on previous discussions in the DR group, but he was adamant. Personally I prefer the prefix notation, but I knew others were quite opposed to it. The history at that point is that Jean was so fed up with what he felt was a significantly bad decision that would affect acceptance of Ada 95 that he gave up on participation in the design effort. All water under the bridge of course, but everytime I see the kind of confusion that this decision causes among OO folks seeing Ada for the first time, I wonder whether the DR's who voted in favor of putting CLASS into the declaration and doing away with TAGGED might have been right. I think Jean was wrong in his fear that this "mistake" would cause major disaffectation with Ada 95, and I think that history has shown that this was not the case, but still the odd word TAGGED still does cause a lot of raised eyebrows for people coming to the language for the first time. There are many other intersting stories in the Ada 95 design process, but the Salem vote on class was probably the high point in drama :-) If any of the other participants wish to add details, or correct me if they think I got any details wrong, feel free (it's quite a while ago and perhaps I have forgotten some details). Robert Dewar Sent via Deja.com http://www.deja.com/ Before you buy.