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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,2843c5eea3415584 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Newsgroups: comp.lang.ada Subject: Re: APQ References: From: Brian May Date: Fri, 17 Dec 2004 14:45:17 +1100 Message-ID: User-Agent: Gnus/5.1007 (Gnus v5.10.7) Emacs/21.3 (gnu/linux) Cancel-Lock: sha1:GeQ489TwBftowIQftelOw/vKLnc= MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii NNTP-Posting-Host: snoopy.microcomaustralia.com.au X-Trace: news.melbourne.pipenetworks.com 1103255091 202.173.153.89 (17 Dec 2004 13:44:51 +1000) X-Complaints-To: abuse@pipenetworks.com X-Abuse-Info: Please forward all headers to enable your complaint to be properly processed. Path: g2news1.google.com!news1.google.com!news.maxwell.syr.edu!news.mel.connect.com.au!news-north.connect.com.au!news.alphalink.com.au!news.melbourne.pipenetworks.com!not-for-mail Xref: g2news1.google.com comp.lang.ada:7013 Date: 2004-12-17T14:45:17+11:00 List-Id: >>>>> "Randy" == Randy Brukardt writes: Randy> I haven't looked at the code in question, but it certainly Randy> is possible to have concrete operations and components on Randy> an abstract type (the type has be abstract - if it is Randy> tagged - to have abstract subprograms). We do it all the Randy> time in Claw and its related programs. That's the big Randy> difference between an abstract type and an Ada 2005 Randy> interface (which can't have any data or concrete Randy> subprograms). I tried to get it working, but couldn't: ... type Root_Connection_Type is abstract new Ada.Finalization.Limited_Controlled with private; ... procedure Connect(C : in out Root_Connection_Type) is abstract; procedure Connect(C : in out Root_Connection_Type; Same_As : Root_Connection_Type'Class) is abstract; ... gcc-3.4 -c -gnata -gnatf -gnato -gnatwp -O0 comp_mysql.adb apq.ads:126:14: abstract subprogram not allowed for type "Root_Connection_Type" apq.ads:127:14: abstract subprogram not allowed for type "Root_Connection_Type" apq.ads:584:09: nonabstract type has abstract subprogram "Connect" gnatmake: "comp_mysql.adb" compilation error make: *** [mysql1] Error 4 ... What did I do wrong? How do I create a abstract type that is derived from Ada.Finalization.Limited_Controlled? I thought I made it quite clear that Root_Connection_Type is abstract. Should I try the same thing with GNAT? -- Brian May