comp.lang.ada
 help / color / mirror / Atom feed
From: Thomas.Kendelbacher@erno.de (Thomas Kendelbacher)
Subject: Re: Ada95 OOP Questions
Date: 1996/08/01
Date: 1996-08-01T00:00:00+00:00	[thread overview]
Message-ID: <4tpm7o$ld@mailsrv2.erno.de> (raw)
In-Reply-To: 4tor2u$ksg@Masala.CC.UH.EDU


In article <4tor2u$ksg@Masala.CC.UH.EDU>, cosc19z5@Bayou.UH.EDU (Spasmo) writes:
>Gotcha.  So if I declare any type, tagged or not, then operations
>will be inherited and I can refer to them in "child packages"?
>This would mean that "inheritance" is pretty consistent regardless
>of OO extensions or not eh?

Right.

>: There is an essential difference between objects in C++ and Ada, though; in Ada,
>: you can't test for object identity as easily, like writing "this == that" in C++
>: (except if you explicitly switch to access types.) This can be a nuisance if
>: you're used to OO languages which support object identity directly, like C++ or
>: Smalltalk.
>
>Well the equality operations are defined for all types
>so isn't it just a matter of saying if this = that
>in Ada?

No. The standard Ada "=" would just compare the contents of the records (if they
are not limited), so two Persons with equal attributes would be considered the
same person (that's equivalence, in contrast to object identity.)
In C++/Smalltalk, you effectively compare pointers, so two Persons with the same
name and birthday *won't* be merged into siamese twins...
(Remember, in C++ "this" for a class X is declared implicitly as "X* const this"
resp. "const X* const this", depending on the context.)

Of course, you can have the same in Ada, if you use access types explicitly.
In C++ (with the "this" pointer) you get this implicitly, and in Smalltalk
every (non-numeric) object is unique by using object "handles" (references)
uniformly for each and everything. (In fact, in Smalltalk you have two different
operators, "=" testing for equivalence and "==" testing for object identity.)

-- 
Thomas Kendelbacher   |   email : Thomas.Kendelbacher@erno.de
DASA RI / Abt. RIT14  |   voice : +49 421 539 5492 (working hours)
Postfach 28 61 56     |      or : +49 421 57 04 37 (any other time)
D-28361 Bremen        |     fax : +49 421 539 4529 (any time)
Germany






  reply	other threads:[~1996-08-01  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 [this message]
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
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   ` 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-29  0:00   ` David Wheeler
1996-07-30  0:00     ` Spasmo
1996-07-30  0:00     ` Spasmo
1996-07-30  0:00 ` Andre Spiegel
1996-07-30  0:00 ` Robert I. Eachus
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 ` Eric C. Newton
1996-08-14  0:00 ` Ken Garlington
1996-08-14  0:00 ` Jon S Anthony
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