comp.lang.ada
 help / color / mirror / Atom feed
From: cosc19z5@Bayou.UH.EDU (Spasmo)
Subject: Re: Ada95 OOP Questions
Date: 1996/08/04
Date: 1996-08-04T00:00:00+00:00	[thread overview]
Message-ID: <4u1umo$6q7@Masala.CC.UH.EDU> (raw)
In-Reply-To: 31FE03CB.7B74@lmtas.lmco.com


Ken Garlington (garlingtonke@lmtas.lmco.com) wrote:
: Spasmo wrote:

[Snip]

: Depends on what you're abstrating. If you don't want an abstract data type,
: but you want a generic abstract data object, why not do this:

:   generic
:   package Person is

:     procedure Walk;
:     procedure Talk;
:     procedure Eat;

:   private

:     type Person_Type is -- as before
:     Object : Person_Type;

:   end Person;

: Translating your C++ code:

:    package P is new Person;  -- Person p;
:    P.Walk;                   -- p.walk();
:    P.Talk;                   -- p.talk();
:    P.Eat;                    -- p.eat();

: Note, however, that there are things you can't do with a GADO (like
: make an array of Persons) that you can do with an ADT.

Yeah that's something I fiddled with initially but realized
that it just didn't work with arrays and the like.  Sure I
could arbitrarily create as many instances of the above package
as I liked (via new packages) but I couldn't use arrays, linked
lists of them, etc...



: If your complaint is that you like p.eat() better than eat(p), on the
: other hand, then I don't see this as an abstraction difference - just
: a syntax difference.

Right it was the syntax that got to me -- and I came to grips
with that :).


: Just out of curiousity, if Person is declared in the C++ equivalent of
: a package (and I forget the nomenclature -- space?), what does your C++
: code look like?

Well when I used C++, things like namespaces, RTTI (standardized?)
and even exception handling weren't universally implemented so
in all reality these classes were taking up the global name space.



: -- 
: LMTAS - "Our Brand Means Quality"

--
Spasmo
"Everyone has secrets, but sometimes you get caught,
 So if it's just between us, my silence can be bought"
	"Blackmail" by Sloppy Seconds





  reply	other threads:[~1996-08-04  0:00 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-07-28  0:00 Ada95 OOP Questions Spasmo
1996-07-28  0:00 ` David C. Hoos, Sr.
1996-07-28  0:00   ` Spasmo
1996-07-28  0:00 ` Andre Spiegel
1996-07-28  0:00   ` Spasmo
1996-07-29  0:00     ` Thomas Kendelbacher
1996-07-31  0:00       ` Spasmo
1996-08-01  0:00         ` Thomas Kendelbacher
1996-08-02  0:00         ` Gene Ouye
1996-08-01  0:00       ` Jon S Anthony
1996-07-30  0:00     ` Ken Garlington
1996-08-04  0:00       ` Spasmo [this message]
1996-07-30  0:00     ` David Wheeler
1996-07-31  0:00       ` Spasmo
1996-07-29  0:00 ` Andre Spiegel
1996-07-29  0:00   ` David Wheeler
1996-07-30  0:00     ` Spasmo
1996-07-30  0:00     ` Spasmo
1996-07-29  0:00   ` Thomas Kendelbacher
1996-08-02  0:00     ` Robert Dewar
1996-08-05  0:00       ` Thomas Kendelbacher
1996-08-06  0:00         ` Robert I. Eachus
1996-08-06  0:00         ` Robert Dewar
1996-08-06  0:00           ` Thomas Kendelbacher
1996-08-06  0:00             ` Robert A Duff
1996-08-07  0:00               ` Robert Dewar
1996-08-08  0:00                 ` Robert A Duff
1996-08-09  0:00                   ` Robert Dewar
1996-08-12  0:00             ` Robert I. Eachus
1996-08-08  0:00           ` Theodore E. Dennison
1996-08-09  0:00             ` Robert Dewar
1996-08-12  0:00             ` Joel VanLaven
1996-08-10  0:00         ` Chris Morgan
1996-07-30  0:00 ` Robert I. Eachus
1996-07-30  0:00 ` Andre Spiegel
1996-07-30  0:00 ` Andre Spiegel
1996-08-01  0:00 ` Jon S Anthony
1996-08-13  0:00 ` Eric C. Newton
1996-08-14  0:00 ` Ken Garlington
1996-08-14  0:00 ` Jon S Anthony
1996-08-14  0:00 ` Eric C. Newton
1996-08-21  0:00 ` Jon S Anthony
  -- strict thread matches above, loose matches on Subject: below --
1996-08-08  0:00 W. Wesley Groleau (Wes)
1996-08-20  0:00 Farshad Nayeri
1996-08-20  0:00 Farshad Nayeri
1996-08-21  0:00 ` Jon S Anthony
replies disabled

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