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.107.47.11 with SMTP id j11mr19909201ioo.75.1483621916343; Thu, 05 Jan 2017 05:11:56 -0800 (PST) X-Received: by 10.157.42.16 with SMTP id t16mr2661879ota.18.1483621916316; Thu, 05 Jan 2017 05:11:56 -0800 (PST) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!news.glorb.com!b123no543711itb.0!news-out.google.com!u18ni8573ita.0!nntp.google.com!b123no542981itb.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Thu, 5 Jan 2017 05:11:55 -0800 (PST) In-Reply-To: <580eb363-2195-43f3-a589-b01657a1be43@googlegroups.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=91.55.192.110; posting-account=rmHyLAoAAADSQmMWJF0a_815Fdd96RDf NNTP-Posting-Host: 91.55.192.110 References: <29380aa7-0c3b-4908-94c6-aa91f3996b42@googlegroups.com> <580eb363-2195-43f3-a589-b01657a1be43@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <81ccdb14-8623-4096-a944-51c4d73f91a7@googlegroups.com> Subject: Re: Experimenting with the OOP features in Ada From: AdaMagica Injection-Date: Thu, 05 Jan 2017 13:11:56 +0000 Content-Type: text/plain; charset=UTF-8 Xref: news.eternal-september.org comp.lang.ada:33069 Date: 2017-01-05T05:11:55-08:00 List-Id: Am Donnerstag, 5. Januar 2017 12:41:12 UTC+1 schrieb Laurent: > On Wednesday, 4 January 2017 13:44:31 UTC+1, Dmitry A. Kazakov wrote: > > The package name Object gets hidden by the declaration the type Object. > > Change it to: > > > > type Object is abstract new Standard.Object.Entity ... > > > Why Standard? Thought that was for libraries which come preinstalled? Each declaration gets a name, called Direct_Name, and this name hides any homographs that are directly visible at that place. So here type Object -- this hides Object mentioned in the with clause is abstract new Standard.Object -- this qualification makes is visible again .Entity Why Standard? The name of any declaration in Ada can be expanded in the following way: function F return T is I: Integer; I is declared locally within F, thus the expanded name is F.I. Now F itself is declared within some declarative region, say a package, a subprogram, a named declare block, call it D => The expanded name is D.F.I. Now any declaration on library level (a package or subprogram) is conceptually declared within package Standard. So if D is on libray level, the fully expanded name is Standard.D.F.I. Hope you now see why Standard. PS: This fully expanded name does not grant visibility from outside into F.