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,8b8748382fcfacc1 X-Google-Attributes: gid103376,public From: Geoff Bull Subject: Re: friend classes in ada95 Date: 2000/04/18 Message-ID: <38FBBC72.7FDE6583@research.canon.com.au>#1/1 X-Deja-AN: 612492413 Content-Transfer-Encoding: 7bit References: <38F6B617.34E216A7@emw.ericsson.se> <38F887AE.8CDA24E0@acm.org> <8dc8oi$kda$1@nnrp1.deja.com> X-Accept-Language: en Content-Type: text/plain; charset=us-ascii X-Complaints-To: usenet@research.canon.com.au X-Trace: cass.research.canon.com.au 956021841 14577 203.12.174.227 (18 Apr 2000 01:37:21 GMT) Organization: Canon Information Systems Research Australia Mime-Version: 1.0 NNTP-Posting-Date: 18 Apr 2000 01:37:21 GMT Newsgroups: comp.lang.ada Date: 2000-04-18T01:37:21+00:00 List-Id: David Botton wrote: > > If I had the time I would modify GNAT even if just for my own use to add > support for something like: > > class type X is new Y with > interface > A, B > record > new_var : abc; > end record; > > and can this degenerate to (when not implementing an interface): class type X is new Y with record new_var : abc; end record; ? In this case the class keyword is not needed. Also I am worried that you could write class type X is record ... and means exactly the same as type X is tagged record ... I.E. we would have two ways of doing the same thing. Or, if they didn't do the same thing it would become confusing as to when to use "class type" and when to use "type X is tagged" > > interface type ABC; You could also have: type ABC is interface; It seems to me you can probably do this without introducing a new keyword. This is off the top of my head without thinking through, but ... an abstract tagged type with a null record and abstract primitive subprograms looks to me an awful lot like an interface. type ABC is abstract tagged null record; procedure A_Func (This : ABC) is abstract; type DEF is abstract new ABC; procedure B_Func (This : ABC) is abstract; type Y is tagged record ... type X is new X, ABC, DEF with -- maximum of one non "interface" type record ... end record; Ok, the idea of a new keyword is growing on me :-) > I would have a syntax for OO that was not embarassing to talk about in > public What is embarrassing about tagged types? (at least we don't have the C++ rtti mess, or that abstract virtual function syntax) Presumably some people must have argued for compromise syntax: tagged type X is record Cheers Geoff