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 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!aioe.org!.POSTED!not-for-mail From: "J-P. Rosen" Newsgroups: comp.lang.ada Subject: Re: controlled types and point of instanciation Date: Fri, 16 Mar 2018 17:31:51 +0100 Organization: Adalog Message-ID: References: NNTP-Posting-Host: vtydEJu0RziDZHka7ZZ6bg.user.gioia.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Complaints-To: abuse@aioe.org User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 X-Notice: Filtered by postfilter v. 0.8.3 Content-Language: fr Xref: reader02.eternal-september.org comp.lang.ada:51031 Date: 2018-03-16T17:31:51+01:00 List-Id: Le 16/03/2018 à 15:39, Mehdi Saada a écrit : > I make the humble request of an exegesis of this text: (from ada 95 the craft of oriented programming) > "Since Ada.Finalization.Limited_Controlled and Ada.Finalization.Controlled are both library-level types, all controlled types must be derived by instantiation at library level. Since generic packages are treated as being declared at the point of instantiation, this means that JE.Lists can only be instantiated at library level, usually within the specification of another library package. This means that we can no longer use JE.Lists to build opaque types as [bellow]. Instantiating JE.Lists inside a package body is no longer permissible." This was a rule of Ada95 intended to prevent accessing non existing objects, but very annoying in practice, precisely because it forbad instantiating the containers anywhere else than at library level. Since Ada 2005, it has been replaced by a run-time check, so you don't need to worry. -- J-P. Rosen Adalog 2 rue du Docteur Lombard, 92441 Issy-les-Moulineaux CEDEX Tel: +33 1 45 29 21 52, Fax: +33 1 45 29 25 00 http://www.adalog.fr