comp.lang.ada
 help / color / mirror / Atom feed
* 'Protected' abstract subprograms
@ 2014-01-10 22:00 sbelmont700
  2014-01-10 22:30 ` Randy Brukardt
                   ` (2 more replies)
  0 siblings, 3 replies; 30+ messages in thread
From: sbelmont700 @ 2014-01-10 22:00 UTC (permalink / raw)


I find it to be a fairly common occurrence and, depending on who you ask, a programming best practice to have a publically visible non-abstract dispatching operation re-dispatch to an abstract subprogram (i.e. the 'template pattern').  But Ada cannot have abstract private subprograms, presumably "because a nonabstract type extension declared outside the package would not know about any abstract primitive subprograms..."

But this doesn't really seem like the case, since A) it can already kind of 'see into' the private part to actually extend the type and B) the private part of a child package can *actually* see into the private part of the parent, which is presumably where the operation would be overridden anyhow.  C++ can have protected/private pure virtual functions, so what's stopping Ada?

In any case, does anyone know of a workaround to achieve the same sort of behavior?  I can always just leave both subprograms public, but that leaves an ugly scab I just need to pick at.

-sb


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

end of thread, other threads:[~2014-01-22  8:27 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-10 22:00 'Protected' abstract subprograms sbelmont700
2014-01-10 22:30 ` Randy Brukardt
2014-01-11 16:12   ` sbelmont700
2014-01-14  3:45     ` Randy Brukardt
2014-01-14  9:05       ` Dmitry A. Kazakov
2014-01-15  0:36         ` Randy Brukardt
2014-01-15  9:17           ` Dmitry A. Kazakov
2014-01-15 14:11             ` Robert A Duff
2014-01-15 15:40               ` adambeneschan
2014-01-15 21:21                 ` Robert A Duff
2014-01-15 23:10                   ` Randy Brukardt
2014-01-16  0:51                     ` Robert A Duff
2014-01-16 10:43                       ` AdaMagica
2014-01-16 16:32                         ` adambeneschan
2014-01-17  1:49                         ` Robert A Duff
2014-01-17 23:23                           ` Randy Brukardt
2014-01-19 21:07                             ` Robert A Duff
2014-01-20  8:40                               ` Dmitry A. Kazakov
2014-01-21 14:37                                 ` Robert A Duff
2014-01-22  8:27                                   ` Dmitry A. Kazakov
2014-01-21  1:21                               ` Randy Brukardt
2014-01-21 14:35                                 ` Robert A Duff
2014-01-15 23:17               ` Randy Brukardt
2014-01-16  8:52               ` Dmitry A. Kazakov
2014-01-11  8:41 ` J-P. Rosen
2014-01-11  8:59 ` Dmitry A. Kazakov
2014-01-11 13:42   ` Niklas Holsti
2014-01-11 19:35     ` Dmitry A. Kazakov
2014-01-12  9:19       ` Niklas Holsti
2014-01-12 10:22         ` Dmitry A. Kazakov

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