comp.lang.ada
 help / color / mirror / Atom feed
From: cosc19z5@Bayou.UH.EDU (Spasmo)
Subject: Re: Ada95 OOP Questions
Date: 1996/07/30
Date: 1996-07-30T00:00:00+00:00	[thread overview]
Message-ID: <4tkbm8$oto@Masala.CC.UH.EDU> (raw)
In-Reply-To: 4tjaai$1hp@news.ida.org


[I've read Small, and think I actually learned something :) so I'm
just posting here to check and also so no bandwidth is wasted
on trying to help me out if I've already gotten this]


David Wheeler (wheeler@aphrodite.csed.ida.org) wrote:
: Andre Spiegel (spiegel@berlin.informatik.uni-stuttgart.de) wrote:
: : Spasmo writes:

[Snip]

: : > Correct me if I'm wrong on this.  So you're still passing parameters
: : > which means that data and subprograms are still 2 different entities
: : > which sorta hurts the abstraction, rather than in say C++ where 
: : > you've got a unified object.   

: : You _are_ wrong.  The subprograms actually _are_ a part of the object,
: : and they "go" with it, so to speak of, whereever you take the object.
: : It is just less obvious from the syntax in Ada.

I took your advice and looked at some of the OO parts of your
"Small" program (Thing and its children), and I think I
understand things now.  In any case I'm going to go back
and check out "Small" again, it looks like a cool program
and studying it can teach me some valuable stuff!

Here are things as I understand them (correct me if I'm wrong).

I did a very simple parent class and a function accepting that
parent class as an argument in a package.

In another package I declared another class that inherited from
the parent class but did nothing else.  This package of course
with'ed the parent package.

I then wrote a program that with'ed the child package and called
a function that wasn't defined in the child class, but in
the parent class and it went through fine.

What I'm concluding from this is that the functions are inherited
and for this to happen a few things need to be met:
	1) The package defining the parent class has to be visible
	2) The package that with's the parent class declares a
	   child class.
	3) Any functions inherited are functions that take the
	   parent class as an argument.

So what it is is that a subprogram really does belong to a class,
but the way we mark a subprogram as being a member of a class
is if it accepts that class as one of its parameters right?  So
we're still passing objects to subprograms but inheritance,
etc... are in fact performed, it's just the arguments that
"tag" (loose use of this term) a subprogram as a class method
and imply inheritance into other packages.

If I'm incorrect on any of this or if anyone wants to add in
I'm all ears.  I hope I got it right because it's starting
to make sense :)



: Spiegel's right.  Spasmo - you're concentrating on minor syntactic variance.
: Ada treats all calls with the same syntax; C++'s syntax varies depending
: on how it's defined.  The difference is unimportant.

Well this variance had me genuinely confused so I didn't see the
true nature of OOP in Ada95.


: To see an example of OO in Ada95, look at my "Small" program at:
:   "http://lglwww.epfl.ch/Ada/Tutorials/Lovelace/small.htm"
: You'll see lots of OO concepts, and operations unified with the object.

Yep I looked at your "Small" program and if what I said above
is on the mark, then it's finally gotten me to realize what
you poor folks have been trying to drive into my thick skull.


: --- David A. Wheeler
: Net address: dwheeler@ida.org


--
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-07-30  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
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 [this message]
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 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-06  0:00         ` Robert I. Eachus
1996-08-10  0:00         ` Chris Morgan
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