comp.lang.ada
 help / color / mirror / Atom feed
* How to stop inheritance in a good way?
@ 2020-01-15  8:32 reinert
  2020-01-15  9:08 ` Dmitry A. Kazakov
                   ` (4 more replies)
  0 siblings, 5 replies; 10+ messages in thread
From: reinert @ 2020-01-15  8:32 UTC (permalink / raw)


Assume I define a tagged record (or interface) + derived types:

 type int1_t is interface;
 function A(x : int1_t) return Integer is abstract;

 type object1_t is abstract new int1_t with private;
 function A(x : object1_t) return Integer;
 function B(x : object1_t) return Integer;

 type object2_1_t is new object1_t with private;
 function C(x : object2_1_t) return Integer;

 type object2_2_t is new object1_t with private;
 function D(x : object2_2_t) return Integer;

and I want object2_2_t *not* to inherit the function B (from type object1_t).
I can make a dummy function B for object2_2_t (to override), but is it a more elegant/proper way? Or I here somehow break the concept of inheritance and enter a "dead end" ?

reinert


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2020-01-20  4:32 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-15  8:32 How to stop inheritance in a good way? reinert
2020-01-15  9:08 ` Dmitry A. Kazakov
2020-01-15 20:56 ` Randy Brukardt
2020-01-15 23:19 ` Jere
2020-01-17  9:48   ` reinert
2020-01-17 21:17     ` Optikos
2020-01-17 13:39 ` Shark8
2020-01-20  4:32   ` ric.wai88
2020-01-17 16:56 ` AdaMagica
2020-01-17 23:51   ` Jeffrey R. Carter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox