comp.lang.ada
 help / color / mirror / Atom feed
From: eachus@spectre.mitre.org (Robert I. Eachus)
Subject: Re: Ada95 OOP Questions
Date: 1996/07/30
Date: 1996-07-30T00:00:00+00:00	[thread overview]
Message-ID: <EACHUS.96Jul30153047@spectre.mitre.org> (raw)
In-Reply-To: 4tf3l4$4hu@masala.cc.uh.edu


In article <4tkbm8$oto@Masala.CC.UH.EDU> cosc19z5@Bayou.UH.EDU (Spasmo) writes:

 > ...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.

   Not quite.  A subprogram is inheritable if it is a primitive
operation of the type.  This basically means that it is declared in
the same package specification (implicitly or explicitly) and has a
parameter OR A RESULT of the type.

   A call to a primitive operation is dispatching if the type of the
controlling operand must be determined at run-time.  (If you declare
two or more tagged types in a single package, you cannot declare
subprograms which are dispatching operations of more than one of those
types.  RM 3.9.2(12) Just thought you might want to know.  Of course,
if you declare several tagged types in one scope, they are usually
related by derivation, so in practice this is not too restrictive.)

  The real nice thing about Ada though, is that you don't need to
understand what I just said.  Write the code you want, and either the
program will compile, link, and run, and do what you expected, or
compiler will complain.  (Most compiler error messages for these
obscure rules do not indicate a violation of the rule, but some other
bug.  So if you run into one of these HUH? error messages, check the
simple things first.  A typical case is that you copied the
declaration for a function on the parent, and changed the types of the
parameters, but forgot to change the result type.)
--

					Robert I. Eachus

with Standard_Disclaimer;
use  Standard_Disclaimer;
function Message (Text: in Clever_Ideas) return Better_Ideas is...




  parent 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 ` 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     ` David Wheeler
1996-07-31  0:00       ` Spasmo
1996-07-30  0:00     ` Ken Garlington
1996-08-04  0:00       ` Spasmo
1996-07-28  0:00 ` David C. Hoos, Sr.
1996-07-28  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 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 ` Robert I. Eachus [this message]
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