From: Chris Powell <chris.powell@rrds.co.uk>
Subject: Re: Help me to chose between ADA 95 and C++
Date: 1999/12/23
Date: 1999-12-23T10:28:39+00:00 [thread overview]
Message-ID: <3861F93C.5CA3A89B@rdel.co.uk> (raw)
In-Reply-To: uu2llb17k.fsf@gsfc.nasa.gov
Stephen Leake wrote:
> Hmm. I don't see why Dispatching_Method should _want_ to re-dispatch.
> You could simply override Dispatching_Method, in addition to
> Another_Dispatching_Method. Can you give a good example of when this
> is not a good idea?
My example was too simple. In reality, Dispatching_Method would perform
some other functionality as well as calling Another_Dispatching_Method.
Overriding Dispatching_Method would mean this behaviour would need to be
reimplemented in the derived class, probably via cut and paste.
> > Passing 'This' as an access parameter is common (since references to
> > objects are often stored by an object, but further complicates the
> > syntax.
>
> No problem here. The syntax is complicated (I assume you are refering
> to "Object'Class (This.all)'Access") because you are doing things the
> hard way; just override Dispatching_Method.
No, I only write the same bit of code once: in the base class.
> In Ada, you have complete control over whether a call dispatches or
> not. If the actual parameter is class-wide, you get dispatching.
> Otherwise, you get static binding. Static binding is a Good Thing in
> some situations; I'm not clear you ever get it in C++.
Yes C++ has both. The difference is that C++ uses dynamic binding by
default and Ada uses static.
> C++ uses "object.method". Ada uses Method (object). Same logical
> association. Hmm, if you have more parameters, and don't put the
> object first in Ada, you might lose something. Once again, Ada gives
> you a choice, C++ doesn't.
C++ does allow binary methods which are defined outside a class, so in
fact it is C++ which gives you the choice, and Ada which does not.
Chris.
next prev parent reply other threads:[~1999-12-23 0:00 UTC|newest]
Thread overview: 67+ messages / expand[flat|nested] mbox.gz Atom feed top
1999-11-26 0:00 Help me to chose between ADA 95 and C++ Robert
1999-11-26 0:00 ` Preben Randhol
1999-11-26 0:00 ` Preben Randhol
1999-11-26 0:00 ` Harald Schmidt
1999-11-26 0:00 ` Andreas Winckler
1999-11-26 0:00 ` Florian Weimer
1999-12-04 0:00 ` Richard D Riehle
[not found] ` <01bf3e32$0b9dc880$022a6282@dieppe>
1999-12-10 0:00 ` Chris Powell
1999-12-13 0:00 ` Richard D Riehle
1999-12-14 0:00 ` Chris Powell
1999-12-14 0:00 ` Richard D Riehle
1999-12-14 0:00 ` Matthew Heaney
1999-12-14 0:00 ` Ray Blaak
1999-12-14 0:00 ` Larry Kilgallen
1999-12-15 0:00 ` Robert A Duff
2000-01-12 0:00 ` Richard Pinkall-Pollei
1999-12-14 0:00 ` Simon Wright
1999-12-15 0:00 ` Chris Powell
1999-12-15 0:00 ` Robert A Duff
1999-12-15 0:00 ` Ted Dennison
1999-12-20 0:00 ` Stefan Skoglund
1999-12-16 0:00 ` Pascal Obry
1999-12-16 0:00 ` Lutz Donnerhacke
1999-12-16 0:00 ` Aidan Skinner
1999-12-16 0:00 ` Rakesh Malhotra
1999-12-21 0:00 ` Geoff Bull
1999-12-21 0:00 ` Robert Dewar
1999-12-21 0:00 ` Chris Powell
1999-12-21 0:00 ` Ted Dennison
1999-12-21 0:00 ` Robert Dewar
1999-12-13 0:00 ` Marin D. Condic
1999-12-13 0:00 ` Brian Rogoff
1999-12-14 0:00 ` Chris Powell
1999-12-14 0:00 ` Preben Randhol
1999-12-14 0:00 ` Stephen Leake
1999-12-14 0:00 ` Tucker Taft
1999-12-15 0:00 ` Stephen Leake
1999-12-15 0:00 ` Preben Randhol
1999-12-14 0:00 ` Brian Rogoff
1999-12-15 0:00 ` Richard Pinkall-Pollei
1999-12-15 0:00 ` Richard Pinkall-Pollei
1999-12-21 0:00 ` Geoff Bull
1999-12-21 0:00 ` Tucker Taft
1999-12-22 0:00 ` Ted Dennison
1999-12-13 0:00 ` DuckE
1999-12-14 0:00 ` Matthew Heaney
1999-12-14 0:00 ` Matthew Heaney
1999-12-14 0:00 ` Chris Powell
1999-12-14 0:00 ` Tucker Taft
1999-12-14 0:00 ` Matthew Heaney
1999-12-23 0:00 ` Chris Powell
1999-12-27 0:00 ` Robert A Duff
1999-12-14 0:00 ` Matthew Heaney
1999-12-15 0:00 ` Hyman Rosen
1999-12-14 0:00 ` Stephen Leake
1999-12-23 0:00 ` Chris Powell [this message]
1999-11-26 0:00 ` Andreas Winckler
1999-11-27 0:00 ` Lionel Draghi
-- strict thread matches above, loose matches on Subject: below --
1999-12-14 0:00 Robert C. Leif, Ph.D.
1999-12-15 0:00 ` Richard D Riehle
1999-12-15 0:00 Robert C. Leif, Ph.D.
1999-12-16 0:00 ` Richard D Riehle
1999-12-16 0:00 ` Matthew Heaney
1999-12-17 0:00 ` Richard D Riehle
1999-12-18 0:00 ` Matthew Heaney
1999-12-20 0:00 ` Richard D Riehle
1999-12-22 0:00 Help me to chose between ADA 95 and C++ ( Ehud Lamm
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox