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,f34f2cf6eacd2bc8 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.204.142.2 with SMTP id o2mr2225957bku.0.1319264961960; Fri, 21 Oct 2011 23:29:21 -0700 (PDT) Path: l23ni27723bkv.0!nntp.google.com!news2.google.com!news3.google.com!feeder.news-service.com!aioe.org!news.tornevall.net!.POSTED!not-for-mail From: Jeffrey Carter Newsgroups: comp.lang.ada Subject: Re: Private constant of tagged limited controlled type Date: Fri, 21 Oct 2011 23:29:19 -0700 Organization: TornevallNET - http://news.tornevall.net Message-ID: References: NNTP-Posting-Host: c901f8e49841b317f2102426694da3bc Mime-Version: 1.0 X-Trace: 53cf10f9a779fb05b5884f705e11ca23 X-Complaints-To: abuse@tornevall.net User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.23) Gecko/20110922 Thunderbird/3.1.15 X-Complaints-Language: Spoken language is english or swedish - NOT ITALIAN, FRENCH, GERMAN OR ANY OTHER LANGUAGE! In-Reply-To: X-UserIDNumber: 1738 X-Validate-Post: http://news.tornevall.net/validate.php?trace=53cf10f9a779fb05b5884f705e11ca23 X-Complaints-Italiano: Non abbiamo padronanza della lingua italiana - se mandate una email scrivete solo in Inglese, grazie X-Posting-User: 0243687135df8c4b260dd4a9a93c79bd Xref: news2.google.com comp.lang.ada:14142 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Date: 2011-10-21T23:29:19-07:00 List-Id: On 10/21/2011 11:14 PM, Malaise wrote: > The following complains that "initialization of limited object > requires aggregate or function call": Right. > with Ada.Finalization; > package Pack is > type T is tagged limited private; > C : constant T; > private > type T is new Ada.Finalization.Limited_Controlled with record > I : Integer := 0; > end record; > V : T; > C : constant T := V; > end Pack; > Aggregate seems impossible because Limited_Controlled is abstract and > anyway T is very complex in fact. I suggest you read ARM 4.3.1 and 4.3.2. You can write an aggregate of the form (Ada.Finalization.Limited_Controlled with others => <>) > A function (returning tagged type) has to be visible and anyway cannot > return V (in Ada 2005). This is an unusual claim. The extended return statement was introduced specifically for returning limited types from a function. You ought to read ARM 6.5. You could write return X : T; to return a value of T with all components set to their default values. -- Jeff Carter "We use a large, vibrating egg." Annie Hall 44