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=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.140.104.163 with SMTP id a32mr21805821qgf.16.1462136157414; Sun, 01 May 2016 13:55:57 -0700 (PDT) X-Received: by 10.157.13.119 with SMTP id 110mr346655oti.17.1462136157329; Sun, 01 May 2016 13:55:57 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!feeder.eternal-september.org!news.glorb.com!11no626459qgt.0!news-out.google.com!uv8ni36igb.0!nntp.google.com!sq19no1241324igc.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Sun, 1 May 2016 13:55:57 -0700 (PDT) In-Reply-To: <15f01439-2333-4482-a37c-3aeb33102c4d@googlegroups.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=2601:18f:900:8350:453d:87a5:de7c:1786; posting-account=AvekzAoAAABj-TclKcOWQmXwA49MFPGX NNTP-Posting-Host: 2601:18f:900:8350:453d:87a5:de7c:1786 References: <15f01439-2333-4482-a37c-3aeb33102c4d@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <3043d4f4-299d-4a8b-b8e9-cb029b1e9e32@googlegroups.com> Subject: Re: I have no idea why this will not compile. From: John Smith Injection-Date: Sun, 01 May 2016 20:55:57 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Xref: news.eternal-september.org comp.lang.ada:30330 Date: 2016-05-01T13:55:57-07:00 List-Id: That's more helpful, thanks. And no, I'm not very proficient in Ada, hence= my=20 confusion. Based on what you suggested, option two makes the most sense. Again, since I'm still learning, this is what I've come up with: http://pastebin.ca/3588100 And now I'm getting the following error: "full view of private extension must be an extension" On Sunday, May 1, 2016 at 6:10:34 AM UTC-4, mockturtle wrote: > You already received two answers that help you to solve the problem. How= ever, depending on your knowledge of Ada, maybe a longer explanation could = be useful. >=20 > "limited" in Ada is used to mark a type that cannot be copied. For examp= le, task types are limited (it does not make much sense copying a task), pr= otected objects are limited (what means to copy them is doubtful). In the = case of File_Type I guess they are limited because the file has an "interna= l state" that could be bring to subtle errors if copied. (BTW, also in C y= ou never copy a FILE, but a pointer to FILE, never copying the underling st= ructure). >=20 > In Ada is not permitted to use a limited type as a component of a *non li= mited* record, since this would allow you to avoid the original limited res= triction (by copying the record you would copy also the limited component).= Because of this, Ada requires that you declare limited any record that ha= s a limited component. >=20 > Solutions? I can think about three solutions: >=20 > 1. Make the record limited > 2. Use an access to the limited type > 3. Move the limited component outside the record >=20 > I think that the best solution depends on your specfic case. >=20 > Riccardo