AdaPower Logged in as Guest
Ada Tools and Resources

Ada 95 Reference Manual
Ada Source Code Treasury
Bindings and Packages

Join >
Articles >
Ada FAQ >
Getting Started >
Home >
Books & Tutorials >
Source Treasury >
Packages for Reuse >
Latest Additions >
Ada Projects >
Press Releases >
Ada Audio / Video >
Home Pages >
Links >
Contact >
About >
Login >
Can you access super methods?

Do you mean "call the operation of the type's parent"?

The answer is yes, by converting the object to the parent type, and then invoking the operation.

For example, suppose I have some special kind of bounded stack:

package Stacks.Bounded_G.Special_G is

  type Stack_Type is new Bounded_G.Stack_Type with private;

  procedure Push (...);


-- instantiate the special stack package --

Now let's call the parent Push operation:

   Stack : Integer_Stacks.Bounded.Special.Stack_Type;
   Push (1234, On => Bounded.Stack_Type (Stack));

Even though the Stack object is of specific type Special.Stack_Type, which has its own version of Push, the Push operation of its parent is invoked.

No, Ada95 does not have a way to say "invoke my parent's operation."

(Matthew Heaney)

(c) 1998-2004 All Rights Reserved David Botton