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 Path: g2news1.google.com!news1.google.com!newsread.com!newsprint.newsread.com!news.glorb.com!meganewsservers.com!feeder2.on.meganewsservers.com!feed.cgocable.net!read2.cgocable.net.POSTED!53ab2750!not-for-mail From: "Warren W. Gay VE3WWG" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.2) Gecko/20040804 Netscape/7.2 (ax) X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: APQ References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Message-ID: Date: Thu, 16 Dec 2004 23:03:48 -0500 NNTP-Posting-Host: 24.150.168.167 X-Complaints-To: abuse@cogeco.ca X-Trace: read2.cgocable.net 1103256166 24.150.168.167 (Thu, 16 Dec 2004 23:02:46 EST) NNTP-Posting-Date: Thu, 16 Dec 2004 23:02:46 EST Organization: Cogeco Cable Xref: g2news1.google.com comp.lang.ada:7014 Date: 2004-12-16T23:03:48-05:00 List-Id: Brian May wrote: >>>>>>"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? The error looks familiar, though I don't understand the reason for the "limitation" that the compiler is imposing. Warren.