From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=0.6 required=5.0 tests=BAYES_40,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,5ea4e8c5a1c5a499,start X-Google-Attributes: gid103376,public From: Robert Oeckl Subject: Polymorphism question Date: 1997/02/20 Message-ID: <330C9CB8.41C6@pheno.physics.wisc.edu>#1/1 X-Deja-AN: 220204919 Content-Type: text/plain; charset=us-ascii Organization: University of Wisconsin - Madison Mime-Version: 1.0 Newsgroups: comp.lang.ada X-Mailer: Mozilla 3.0 (X11; I; OSF1 V3.2 alpha) Date: 1997-02-20T00:00:00+00:00 List-Id: 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