comp.lang.ada
 help / color / mirror / Atom feed
From: dewar@merv.cs.nyu.edu (Robert Dewar)
Subject: Re: Can Ada95 interface with C++?
Date: 1997/02/24
Date: 1997-02-24T00:00:00+00:00	[thread overview]
Message-ID: <dewar.856787229@merv> (raw)
In-Reply-To: 1997Feb12.004642.31821@ocsystems.com


Joel says

<<For example, C++ classes without virtual functions are called
"nonpolymorphic" classes.  There is no such thing in Ada95 because a
a CALL to a primitive op of a tagged type in Ada95 is what determines
whether the call dispatches, not the declaration of the operation.  Another
big problem is the different way initialization/finalization is handled.
None of this even touches upon MI (ack)>>


There is no problem in defining the equivalent of nonpolymorphic classes.
To define "methods" in Ada 95 that are not virtual (using the C++
terminology), just don't make them primitive. Then they can be applied
to any member of the class (the formal type is x'class in this case).

It *is* the declaration of the operation in Ada 95 that determines whether
the call dispatches. A class wide operation never dispatches. So the first
concern here just seems plain wrong.

I do not see why initialization/finalization is a big problem either. The
GNAT interface design provides a clean way of interfacing to constructors
and destructors (though this is not fuly implemented yet).

Finally, the GNAT design handles multiply inherited classes without a
problem. You cannot *define* such a class within Ada, but you can
certainly *import* such a class.





  parent reply	other threads:[~1997-02-24  0:00 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <5csvbd$ia2@top.mitre.org>
     [not found] ` <32F60684.59E2@gslink.net>
     [not found]   ` <32F94DD7.3F54BC7E@worldnet.att.net>
     [not found]     ` <dewar.855234605@merv>
1997-02-18  0:00       ` Can Ada95 interface with C++? John Cosby
     [not found]     ` <1997Feb6.150722.14570@ocsystems.com>
     [not found]       ` <1997Feb6.130819.1@eisner>
     [not found]         ` <dewar.855276105@merv>
     [not found]           ` <tx1bu9rp8sr.fsf@cygnus.com>
1997-02-11  0:00             ` Larry Kilgallen
1997-02-12  0:00               ` Joel VanLaven
1997-02-14  0:00                 ` Ken Raeburn
1997-02-24  0:00                 ` Robert Dewar [this message]
1997-02-24  0:00                 ` Robert Dewar
1997-02-12  0:00             ` Robert Dewar
1997-02-20  0:00             ` Samuel Mize
1997-02-21  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