comp.lang.ada
 help / color / mirror / Atom feed
From: Tucker Taft <stt@averstar.com>
Subject: Re: Generic abstracts
Date: 1999/11/29
Date: 1999-11-29T00:00:00+00:00	[thread overview]
Message-ID: <3842BFFB.70B08603@averstar.com> (raw)
In-Reply-To: slrn83q37i.kn.lutz@taranis.iks-jena.de

Lutz Donnerhacke wrote:
> 
> Somebody might remember a unspecific quotation from the reference manual
> about prohibiting abstract declarations in generic packages.
> 
> In my current developemnt I came across this problem again.
> ...
>    generic
>       with procedure On_Item (E : in out S);
>    procedure         Iterate (B : in     Bla)    is abstract;
> --                                               ^ missing ';'.
> -- Providing a sensless dummy function works.
> 
>    generic
>       with function Is_Match (E : in S)   return Boolean;
>    function         Find     (B : in Bla) return Position is abstract;
> --                                                        ^ missing ';'.
> -- Providing a dummy function is not possible, because no return value exists.
> end X;
> 
> The abstract definition should be used to ensure a consistent
> inteface. I have two problems:
>   - A generic procedure which can be missed on implementation.
>     Raising an exception might be acceptable.
>   - It is not possible to predefine a body for a generic function.
>     No return value is available.
>     Raising an exception does not stop the compiler from requiring
>     a return value.
> 
> Any hints?

I'm unclear as to what you are trying to accomplish by including
generic subprograms that are abstract.  Generic subprograms are
not inherited, so there is no point in declaring them on an
abstract type.  

Perhaps if you showed how the generic package was going to be
instantiated and used, I might be able to suggest a solution to
your problem.


-- 
-Tucker Taft   stt@averstar.com   http://www.averstar.com/~stt/
Technical Director, Distributed IT Solutions  (www.averstar.com/tools)
AverStar (formerly Intermetrics, Inc.)   Burlington, MA  USA




  parent reply	other threads:[~1999-11-29  0:00 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-11-25  0:00 Generic abstracts Lutz Donnerhacke
1999-11-25  0:00 ` Lutz Donnerhacke
1999-11-29  0:00 ` Tucker Taft [this message]
1999-11-29  0:00   ` Lutz Donnerhacke
1999-11-29  0:00     ` Tucker Taft
1999-11-30  0:00       ` Robert A Duff
1999-11-30  0:00         ` Tucker Taft
1999-11-30  0:00       ` Lutz Donnerhacke
replies disabled

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