comp.lang.ada
 help / color / mirror / Atom feed
From: Geoff Bull <geoff@research.canon.com.au>
Subject: Re: friend classes in ada95
Date: 2000/04/18
Date: 2000-04-18T01:37:21+00:00	[thread overview]
Message-ID: <38FBBC72.7FDE6583@research.canon.com.au> (raw)
In-Reply-To: mvnK4.4943$I75.3573293@news-east.usenetserver.com

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




  parent reply	other threads:[~2000-04-18  0:00 UTC|newest]

Thread overview: 91+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-04-14  0:00 friend classes in ada95 Stefan Folkesson
2000-04-14  0:00 ` swhalen
2000-04-14  0:00 ` Florian Weimer
2000-04-14  0:00   ` Stefan Folkesson
2000-04-14  0:00 ` Julian Day
2000-04-14  0:00   ` Steve Folly
2000-04-14  0:00     ` Robert A Duff
2000-04-17  0:00       ` John J. Rusnak
2000-04-18  0:00         ` Vincent Marciante
2000-04-18  0:00           ` John Rusnak
2000-04-18  0:00       ` Steve Folly
2000-04-14  0:00 ` John J. Rusnak
2000-04-15  0:00 ` Jeff Carter
2000-04-16  0:00   ` Robert Dewar
2000-04-16  0:00     ` Jeff Carter
2000-04-16  0:00       ` David Botton
2000-04-17  0:00         ` Robert Dewar
2000-04-17  0:00           ` Hyman Rosen
2000-04-17  0:00             ` Robert Dewar
2000-04-16  0:00     ` David Botton
2000-04-17  0:00       ` Robert Dewar
2000-04-17  0:00         ` David Botton
2000-04-17  0:00         ` David Botton
2000-04-18  0:00           ` friend classes in ada95 (long) tmoran
2000-04-18  0:00             ` David Botton
2000-04-18  0:00               ` friend classes in ada95 Stanley R. Allen
2000-04-19  0:00               ` MI, was " tmoran
2000-04-19  0:00                 ` David Botton
2000-04-19  0:00               ` friend classes in ada95 (long) Brian Rogoff
2000-04-19  0:00                 ` David Botton
2000-04-19  0:00                 ` Hyman Rosen
2000-04-19  0:00                   ` Brian Rogoff
2000-04-23  0:00                     ` Hyman Rosen
2000-04-23  0:00                       ` Brian Rogoff
2000-04-24  0:00                         ` Hyman Rosen
2000-04-25  0:00                           ` Brian Rogoff
2000-04-25  0:00                             ` Ole-Hjalmar Kristensen
2000-04-18  0:00       ` Geoff Bull [this message]
2000-04-18  0:00         ` friend classes in ada95 Jean-Pierre Rosen
2000-04-18  0:00           ` tmoran
2000-04-18  0:00             ` John J. Rusnak
2000-04-19  0:00               ` Geoff Bull
2000-04-19  0:00                 ` Robert Dewar
2000-04-19  0:00                 ` Ehud Lamm
2000-04-19  0:00                 ` David Botton
2000-04-19  0:00                   ` Robert Dewar
2000-04-19  0:00                   ` Robert Dewar
2000-04-20  0:00                     ` Geoff Bull
2000-04-19  0:00                 ` Jeff Susanj
2000-04-19  0:00                   ` Robert Dewar
2000-04-19  0:00                     ` Jeff Carter
2000-04-19  0:00                       ` Ray Blaak
2000-04-20  0:00                         ` Robert Dewar
2000-04-20  0:00                           ` Ray Blaak
2000-04-20  0:00                             ` Charles Hixson
2000-04-21  0:00                               ` Jean-Pierre Rosen
2000-04-29  0:00                                 ` Aidan Skinner
2000-04-29  0:00                                   ` Robert I. Eachus
2000-04-21  0:00                               ` Jon S Anthony
2000-04-20  0:00                         ` Jean-Pierre Rosen
2000-04-20  0:00                           ` Ray Blaak
2000-04-20  0:00                             ` Jean-Pierre Rosen
2000-04-24  0:00                               ` Ray Blaak
2000-04-20  0:00                           ` Robert Dewar
2000-04-20  0:00                             ` Brian Rogoff
2000-04-20  0:00                             ` BSCrawford
2000-04-20  0:00                             ` Jean-Pierre Rosen
2000-04-20  0:00                       ` Robert Dewar
2000-04-20  0:00                         ` Jeff Carter
2000-04-21  0:00                           ` Robert Dewar
2000-04-21  0:00                             ` Ken Garlington
2000-04-21  0:00                             ` Jon S Anthony
2000-04-22  0:00                               ` Robert Dewar
2000-04-19  0:00                   ` Bill Greene
2000-04-19  0:00                   ` tmoran
2000-04-19  0:00               ` Jean-Pierre Rosen
2000-04-19  0:00               ` Robert Dewar
2000-04-18  0:00           ` John Rusnak
2000-04-19  0:00             ` Robert Dewar
2000-04-18  0:00           ` Pascal Obry
2000-04-18  0:00           ` David Botton
2000-04-18  0:00         ` David Botton
2000-04-17  0:00     ` Robert I. Eachus
2000-04-18  0:00       ` Robert Dewar
2000-04-19  0:00         ` Robert I. Eachus
2000-04-20  0:00           ` Robert Dewar
2000-04-20  0:00             ` Ray Blaak
2000-04-23  0:00             ` Robert I. Eachus
2000-04-19  0:00     ` Alfred Hilscher
2000-04-19  0:00       ` Ray Blaak
2000-04-19  0:00         ` Robert Dewar
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox