comp.lang.ada
 help / color / mirror / Atom feed
From: Matthew Heaney <matthew_heaney@acm.org>
Subject: Re: A question for my personal knowledge.
Date: 1999/05/15
Date: 1999-05-15T00:00:00+00:00	[thread overview]
Message-ID: <m3ogjnorwv.fsf@mheaney.ni.net> (raw)
In-Reply-To: 7hfp1n$28tr@drn.newsguy.com

Mike  <Mike@newsguy.com> writes:

> In Ada, you still use function calls and pass tagged records as
> parameters.
> 
> in real OO, you invoke methods on objects.

You are confusing syntax and semantics.  The call

  Push (X, On => Stack);

really does "invoke a method on an object."  


> Also, a class is more clear representation of an object. in Ada, bolting
> OO concepts into a procedural language, makes the way to do OO in Ada
> not very natural at all.

Ada83 was already a class-based language.  All Ada95 was to extend the
existing facilities for class-based programming with type extension.

In Ada83, you did this:

  type T is private;


In Ada95, you do this:

  type T is tagged private;


In Ada83, you did this:

  type NT is new T;

In Ada95, you do this:

  type NT is new T with private;


What's "bolt-on" about that?  Ada95 was designed specifically to NOT add
bolt-on features, so your statement to the contrary is incorrect.

 
> The biggest mistake Ada made in 95 was not introduce the class
> construct as is common in other OO languages.  Who cares if that would
> have broken Ada83 programs, you could have called it X95 for all I
> care, it did not have to be called Ada.

But the class already existed in Ada83: it's called a "private type".

  type Stack_Type is private;

  procedure Push
    (Item : in     Item_Type;
     On   : in out Stack_Type);

  function Get_Top (Stack : Stack_Type) return Item_Type;


In Ada95, I might say:

  type Stack_Type is tagged private;

  procedure Push
    (Item : in     Item_Type;
     On   : in out Stack_Type);

  function Get_Top (Stack : Stack_Type) return Item_Type;


Not much difference, except that in Ada95 I can extend the stack type:

  type My_Special_Stack is new Stack_Type with private;



> sorry, but OO in Ada is not normal OO. I am happy that you have no problem
> with it, but 99% of the rest of the world do not do OO that way Ada does it.

You seem not to understand the difference between syntax and semantics.











  parent reply	other threads:[~1999-05-15  0:00 UTC|newest]

Thread overview: 58+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-05-10  0:00 A question for my personal knowledge Siamak Kaveh
1999-05-10  0:00 ` Larry Kilgallen
1999-05-10  0:00   ` Keith Thompson
1999-05-12  0:00     ` Charlie McCutcheon
1999-05-12  0:00       ` Werner Pachler
1999-05-17  0:00         ` Charlie McCutcheon
1999-05-17  0:00           ` bglbv
1999-05-17  0:00             ` Larry Kilgallen
1999-05-18  0:00               ` bglbv
1999-05-19  0:00                 ` Larry Kilgallen
1999-05-10  0:00 ` Sam
1999-05-10  0:00 ` Marin David Condic
1999-05-10  0:00   ` Paul Whittington
1999-05-10  0:00     ` Marin David Condic
1999-05-10  0:00 ` Roy Grimm
1999-05-11  0:00   ` Pascal Obry
1999-05-11  0:00     ` Roy Grimm
1999-05-11  0:00       ` Marin David Condic
1999-05-11  0:00         ` Roy Grimm
1999-05-11  0:00           ` Tucker Taft
1999-05-11  0:00             ` Roy Grimm
1999-05-12  0:00         ` Roger Racine
1999-05-12  0:00           ` Marin David Condic
1999-05-17  0:00             ` Charlie McCutcheon
1999-05-17  0:00               ` Larry Kilgallen
1999-05-17  0:00                 ` Chris
1999-05-17  0:00                   ` Marin David Condic
1999-05-17  0:00               ` Marin David Condic
1999-05-17  0:00             ` Richard D Riehle
1999-05-18  0:00               ` Marin David Condic
1999-05-18  0:00                 ` bglbv
1999-05-18  0:00                   ` William B. Clodius
1999-05-11  0:00       ` Robert Dewar
1999-05-11  0:00         ` dennison
1999-05-13  0:00           ` Mike Yoder
1999-05-13  0:00             ` Mike
1999-05-13  0:00               ` Martin C. Carlisle
1999-05-14  0:00               ` Dale Stanbrough
1999-05-13  0:00                 ` Mike
1999-05-13  0:00                   ` David Starner
1999-05-18  0:00                     ` Georg Bauhaus
1999-05-13  0:00                   ` Brian Rogoff
1999-05-14  0:00                   ` Florian Weimer
1999-05-14  0:00                     ` Steve
1999-05-15  0:00                       ` Florian Weimer
1999-05-15  0:00                         ` Matthew Heaney
1999-05-14  0:00                   ` Dale Stanbrough
1999-05-15  0:00                   ` Matthew Heaney [this message]
1999-05-18  0:00               ` Richard D Riehle
1999-05-18  0:00                 ` Hyman Rosen
1999-05-18  0:00                   ` Richard D Riehle
1999-05-18  0:00                     ` Hyman Rosen
1999-05-19  0:00                       ` Richard D Riehle
1999-05-11  0:00         ` Roy Grimm
1999-05-12  0:00           ` Robert A Duff
1999-05-10  0:00 ` Dan Nagle
1999-05-11  0:00 ` Jean-Pierre Rosen
1999-05-11  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