comp.lang.ada
 help / color / mirror / Atom feed
From: "Marin David Condic" <marin.condic.auntie.spam@pacemicro.com>
Subject: Abstract Functions
Date: Wed, 11 Jul 2001 10:24:09 -0400
Date: 2001-07-11T14:24:10+00:00	[thread overview]
Message-ID: <9ihnia$i8h$1@nh.pace.co.uk> (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/






             reply	other threads:[~2001-07-11 14:24 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-07-11 14:24 Marin David Condic [this message]
2001-07-11 15:22 ` Abstract Functions 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
  -- strict thread matches above, loose matches on Subject: below --
2001-07-11 14:49 Re[2]: " ANH_VO
2001-07-11 19:01 ` tmoran
2001-07-12 14:10   ` Marin David Condic
replies disabled

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