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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,10b4863a0a2cf267 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!postnews.google.com!g19g2000yqe.googlegroups.com!not-for-mail From: Gautier write-only Newsgroups: comp.lang.ada Subject: Re: Type of the target of an assignment shall not be abstract Date: Tue, 16 Feb 2010 02:03:38 -0800 (PST) Organization: http://groups.google.com Message-ID: References: <770863d9-14ae-4a05-b924-2dfeda7a96a8@f15g2000yqe.googlegroups.com> <39f56354-a2e2-4133-bbad-9343b2f22119@k6g2000prg.googlegroups.com> NNTP-Posting-Host: 206.122.158.4 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1266314618 9458 127.0.0.1 (16 Feb 2010 10:03:38 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Tue, 16 Feb 2010 10:03:38 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: g19g2000yqe.googlegroups.com; posting-host=206.122.158.4; posting-account=gRqrnQkAAAAC_02ynnhqGk1VRQlve6ZG User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/532.5 (KHTML, like Gecko) Chrome/4.0.249.89 Safari/532.5,gzip(gfe),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:9263 Date: 2010-02-16T02:03:38-08:00 List-Id: On 16 Feb., 01:59, Adam Beneschan : > FYI, I asked about this on Ada-Comment, and got a response from > Randy. =A0[...] Thanks! IHMO, no need to worry about how well or not the standard handles that. To answer my original question, can I conclude that GNAT is wrong on that case, and that I can send a report ? > My own recommendation: If you want the 14 components of the abstract > type Excel_Out_Stream to be treated as a unit, then make them a unit--- > i.e. define a record type with 14 components, and then > Excel_Out_Stream would have just one component of that record type. > Of course, that decision probably has to be made when the package is > first written; making that change now would require changing how all > those components are accessed everywhere else in the program. =A0Barring > that, you can either write 14 assignment statements and hope the > compiler is smart enough to optimize them, or you can use a "trick" > like Dmitry's suggestion, which will "work" but (in my opinion) > doesn't help set up a type structure that accurately reflects the > concepts in your program. Sure, but isn't your recommendation a trick as well ? Then I should write xl.X.blabla all over the package's body (where X is the record type you suggest). That for sure will pervert the concepts, readability, etc. Choosing between both tricks, I'd prefer Dmitry's. I'll give a clear name to the concrete-before-abstract type, like "Pre_Root", and try to have it private. Let's see how it turns out... Thanks Gautier