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=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,5232c05e6bbd864d X-Google-Attributes: gid103376,public From: Martin Lorentzon Subject: Re: Dynamic dispatch and calling parent Date: 1996/10/23 Message-ID: #1/1 X-Deja-AN: 191476706 sender: emwson@hera references: organization: Ericsson Microwave Systems AB, Molndal, Sweden newsgroups: comp.lang.ada Date: 1996-10-23T00:00:00+00:00 List-Id: >>>>> "Corey" == Corey Minyard writes: Corey> I am trying to create a dynamically dispached function. I Corey> want the function for the child type to be able to call the Corey> parent's function much like you can in Java, Oberon-2, C++, Corey> etc. package root is type parent is tagged private; procedure foo(this : in parent); private type parent is tagged null record; end root; ------------------------------------------------------------ package root.child is type derived is new parent with private; procedure foo(this : in derived); private type derived is new parent with null record; end root.child; ------------------------------------------------------------ package body root.child is procedure foo(this : in derived) is begin -- Call the parent's operation by casting the type foo(root.parent(this)); -- Do some operations on your own null; end foo; end root.child;