comp.lang.ada
 help / color / mirror / Atom feed
* Re[2]: Abstract Functions
@ 2001-07-11 14:49 ANH_VO
  2001-07-11 19:01 ` tmoran
  0 siblings, 1 reply; 12+ messages in thread
From: ANH_VO @ 2001-07-11 14:49 UTC (permalink / raw)
  To: comp.lang.ada

Absolutely, an abstract tagged type can contain data fields. Of course, object
or variable can not be declared.

A. Vo

<< A question I could get answered by the compiler, but maybe this is less
typing: Can I have an abstract tagged type that has data fields? My
recollection of examples I've seen have not had data - just null records. >>





^ permalink raw reply	[flat|nested] 12+ messages in thread
* Abstract Functions
@ 2001-07-11 14:24 Marin David Condic
  2001-07-11 15:22 ` Ted Dennison
  0 siblings, 1 reply; 12+ messages in thread
From: Marin David Condic @ 2001-07-11 14:24 UTC (permalink / raw)


Suppose you have a tagged type that is not abstract, but you want to provide
functions as a "template" that some inheritor is supposed to override. You
can't make the functions abstract without the tagged type also being
abstract. You might not want that because you might want data and operations
in the parent class that actually work. Is there a way to say "Here's almost
everything you need, but you have to override this function with one of your
own design..." and not have the parent be abstract? I need some way of
forcing the inheritor to provide the function and I'd prefer not to go
generic.

So far, my current answer is to provide the functions I expect to be
overriden and have them raise an exception. This keeps the inheritor from
actually using the functions, but it would be nice to have a compile-time
check that insures the inheritor has to provide the desired functions. Any
ideas?

MDC
--
Marin David Condic
Senior Software Engineer
Pace Micro Technology Americas    www.pacemicro.com
Enabling the digital revolution
e-Mail:    marin.condic@pacemicro.com
Web:      http://www.mcondic.com/






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

end of thread, other threads:[~2001-07-16 22:15 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-07-11 14:49 Re[2]: Abstract Functions ANH_VO
2001-07-11 19:01 ` tmoran
2001-07-12 14:10   ` Marin David Condic
  -- strict thread matches above, loose matches on Subject: below --
2001-07-11 14:24 Marin David Condic
2001-07-11 15:22 ` Ted Dennison
2001-07-11 15:43   ` Marin David Condic
2001-07-11 16:35     ` Ehud Lamm
2001-07-11 17:08       ` Marin David Condic
2001-07-11 17:27     ` Ted Dennison
2001-07-16 21:43     ` Tucker Taft
2001-07-16 22:15       ` Marin David Condic
2001-07-16 21:51     ` Stephen Leake

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