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.2 required=5.0 tests=BAYES_00,FREEMAIL_FROM, FROM_STARTS_WITH_NUMS autolearn=no autolearn_force=no version=3.4.4 X-Received: by 10.107.16.82 with SMTP id y79mr865273ioi.103.1521211150892; Fri, 16 Mar 2018 07:39:10 -0700 (PDT) X-Received: by 2002:a9d:29d2:: with SMTP id g18-v6mr100825otd.5.1521211150742; Fri, 16 Mar 2018 07:39:10 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!feed.usenet.farm!feeder4.feed.usenet.farm!weretis.net!feeder6.news.weretis.net!feeder.usenetexpress.com!feeder-in1.iad1.usenetexpress.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!r195-v6no558822itc.0!news-out.google.com!h73-v6ni898itb.0!nntp.google.com!e10-v6no553655itf.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Fri, 16 Mar 2018 07:39:10 -0700 (PDT) Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=85.240.209.197; posting-account=rhqvKAoAAABpikMmPHJSZh4400BboHwT NNTP-Posting-Host: 85.240.209.197 User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: controlled types and point of instanciation From: Mehdi Saada <00120260a@gmail.com> Injection-Date: Fri, 16 Mar 2018 14:39:10 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Received-Bytes: 2148 X-Received-Body-CRC: 1095763649 Xref: reader02.eternal-september.org comp.lang.ada:51028 Date: 2018-03-16T07:39:10-07:00 List-Id: I make the humble request of an exegesis of this text: (from ada 95 the cra= ft of oriented programming) "Since Ada.Finalization.Limited_Controlled and Ada.Finalization.Controlled = are both library-level types, all controlled types must be derived by insta= ntiation at library level. Since generic packages are treated as being decl= ared at the point of instantiation, this means that JE.Lists can only be in= stantiated at library level, usually within the specification of another li= brary package. This means that we can no longer use JE.Lists to build opaqu= e types as [bellow]. Instantiating JE.Lists inside a package body is no lon= ger permissible." --> it refers to that: package JE.Stacks is -- anything private type Stack_Item; type Stack_Type is access Stack_Item; end JE.Stacks; with JE.Lists; package body JE.Stacks is package Lists is new JE.Lists (Item_Type); type Stack_Item is record L : Lists.List_Type; end record; ... end JE.STACKS; So that I can grasp the rule better, what are the anomalous cases this rule= wants to avoid ?