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.50.244.161 with SMTP id xh1mr8707036igc.3.1462097433083; Sun, 01 May 2016 03:10:33 -0700 (PDT) X-Received: by 10.182.117.40 with SMTP id kb8mr342249obb.7.1462097433028; Sun, 01 May 2016 03:10:33 -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!au2pb.net!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!i5no1028766ige.0!news-out.google.com!uv8ni361igb.0!nntp.google.com!sq19no1000086igc.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Sun, 1 May 2016 03:10:32 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=93.37.233.36; posting-account=9fwclgkAAAD6oQ5usUYhee1l39geVY99 NNTP-Posting-Host: 93.37.233.36 References: User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <15f01439-2333-4482-a37c-3aeb33102c4d@googlegroups.com> Subject: Re: I have no idea why this will not compile. From: mockturtle Injection-Date: Sun, 01 May 2016 10:10:33 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Xref: news.eternal-september.org comp.lang.ada:30328 Date: 2016-05-01T03:10:32-07:00 List-Id: You already received two answers that help you to solve the problem. Howev= er, depending on your knowledge of Ada, maybe a longer explanation could be= useful. "limited" in Ada is used to mark a type that cannot be copied. For example= , task types are limited (it does not make much sense copying a task), prot= ected objects are limited (what means to copy them is doubtful). In the ca= se of File_Type I guess they are limited because the file has an "internal = state" that could be bring to subtle errors if copied. (BTW, also in C you= never copy a FILE, but a pointer to FILE, never copying the underling stru= cture). In Ada is not permitted to use a limited type as a component of a *non limi= ted* record, since this would allow you to avoid the original limited restr= iction (by copying the record you would copy also the limited component). = Because of this, Ada requires that you declare limited any record that has = a limited component. Solutions? I can think about three solutions: 1. Make the record limited 2. Use an access to the limited type 3. Move the limited component outside the record I think that the best solution depends on your specfic case. Riccardo