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=0.4 required=5.0 tests=BAYES_00,FORGED_MUA_MOZILLA autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,43127f177a55dc41 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.42.133.135 with SMTP id h7mr18242735ict.4.1320398305465; Fri, 04 Nov 2011 02:18:25 -0700 (PDT) Path: p6ni69665pbn.0!nntp.google.com!news1.google.com!volia.net!news2.volia.net!feed-A.news.volia.net!news.musoftware.de!wum.musoftware.de!news.weisnix.org!newsfeed.ision.net!newsfeed2.easynews.net!ision!newsfeed.arcor.de!newsspool3.arcor-online.net!news.arcor.de.POSTED!not-for-mail Date: Fri, 04 Nov 2011 10:18:10 +0100 From: Georg Bauhaus User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:7.0.1) Gecko/20110929 Thunderbird/7.0.1 MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: limited allocated classwide types References: <0ed43f83-40e7-46d3-8cc4-e1c41f500d28@c1g2000vbw.googlegroups.com> In-Reply-To: Message-ID: <4eb3add2$0$6570$9b4e6d93@newsspool3.arcor-online.net> Organization: Arcor NNTP-Posting-Date: 04 Nov 2011 10:18:10 CET NNTP-Posting-Host: 2ebdda25.newsspool3.arcor-online.net X-Trace: DXC=J9J8j\o;GZW=>bdbdS?M0YMcF=Q^Z^V3X4Fo<]lROoRQ8kFejVXVOY`hm<_F9Rmf[:nJnMOjV X-Complaints-To: usenet-abuse@arcor.de Xref: news1.google.com comp.lang.ada:18823 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Date: 2011-11-04T10:18:10+01:00 List-Id: On 04.11.11 00:35, Simon Belmont wrote: > > I am only months into being an Ada programmer > and not trying to anything that isn't well described and ostensibly > supported, so it seems odd that such a basic test case would uncover > and compiler bug. Moreover, one of the points of pride is that Ada > compilers are heavily tested and verified for safety critical apps, > which this seems to undercut. Chances are that a traditional way of ensuring the presence of operations for a type might work better---if presence is all that you need(*). Depending, then, on the intent of the solution, one simple solution could be to state the expectations where and when they must be met: generic type Has_Doo_Operation is new Has_Doo with private; package Here_We_Go is procedure System_Function_1 (Tool : in out Has_Doo_Operation; Stuff : Information'Class); procedure System_Function_2 (Tool : in out Has_Doo_Operation; Stuff : in out Flour; More_Stuff : in out Eggs); end Here_We_Go; and then ensure things by first deriving concrete Foo_Type from Limited_Controlled and then passing Foo_Type as actual type for the abstract type or interface Has_Doo_Operation . Or, more flexibly, generic type T is limited private; with procedure Doo (This : T); package Here_We_Go is ... Etc. __ (*) For some old history, rhetoric, emotions, and examples see http://people.cs.kuleuven.be/~dirk.craeynest/ada-mi.html (I remember having read the phrase "multiple inheritance bug has bitten again", somewhere in the Ada archives.)