Randy Brukardt wrote:
> But the *really* best solution is an OOP-based solution. This is extensible
> and type-safe and doesn't require unsafe compares and doesn't even need
> (visible) access types. Admittedly, there is a bit more work up front, but I
> think access types should avoided unless there is really dynamic allocation
> (which can't happen with subprograms in Ada). One of the really nice things
> about Ada 95 is that you can do useful OOP without using any access types.
> Randy Brukardt.
Could you explain please how to avoid visible access type?
I tought we should write something like
package Subscriber is
type Listener is abstract tagged null record;
procedure Action (L : Listener) is abstract;
type Listener_Ptr is access all Listener'Class;
procedure Register (P : Listener_Ptr);
procedure Unregister (P : Listener_Ptr);