comp.lang.ada
 help / color / mirror / Atom feed
From: Robert Oeckl <oeckl@pheno.physics.wisc.edu>
Subject: Polymorphism question
Date: 1997/02/20
Date: 1997-02-20T00:00:00+00:00	[thread overview]
Message-ID: <330C9CB8.41C6@pheno.physics.wisc.edu> (raw)


I have problems to figure out, how Polymorphism works in Ada. I want to
know if and how the following is possible in Ada:

Suppose I have an abstact type A. Now I have two (non-abstract)
descendants B and C of A. Furthermore there is a descendant D of C. For
A an abstract procedure P1 is defined and for B and C P1 is overloaded.
I do also want to be able to call P1 with type D without explicitly
defining P1 for D, so that the procedure as defined for type C is
executed with type D.
Now I have a procedure P2 defined for type C. For type D I want to
overload this procedure. But in the overloaded procedure I want make a
call to P2 as defined for C, if possible without loosing the information
that the object is actually of type D inside the called procedure.

I hope my description of the problem is clear enough. I would greatly
appreciate any code-examples.

Thanks in advance,

Robert


------------------------------------
Robert Oeckl, graduate student
University of Wisconsin
Department of Physics
1150 University Avenue
Madison WI 53706-1390, USA

phone: +1 (608) 262-8947
e-mail: oeckl@pheno.physics.wisc.edu




             reply	other threads:[~1997-02-20  0:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-02-20  0:00 Robert Oeckl [this message]
1997-02-20  0:00 ` Polymorphism question Samuel Mize
1997-02-23  0:00 ` Kirk Beitz
1997-02-23  0:00   ` Robert Dewar
1997-02-23  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