From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,c4a14ea3a6faca74 X-Google-Attributes: gid103376,public From: Tucker Taft Subject: Re: Generic abstracts Date: 1999/11/29 Message-ID: <3842BFFB.70B08603@averstar.com>#1/1 X-Deja-AN: 554500549 Content-Transfer-Encoding: 7bit Sender: news@inmet.camb.inmet.com (USENET news) X-Nntp-Posting-Host: houdini.burl.averstar.com References: X-Accept-Language: en Content-Type: text/plain; charset=us-ascii Organization: AverStar (formerly Intermetrics) Burlington, MA USA Mime-Version: 1.0 Newsgroups: comp.lang.ada Date: 1999-11-29T00:00:00+00:00 List-Id: 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