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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,9747037d09060687 X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news2.google.com!news.glorb.com!news2!nntpserver.com!zeus.nntpserver.com!newsfeed.arcor.de!newsspool2.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: A proposal for formal packages matching Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.15.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: Date: Mon, 15 Dec 2008 14:29:57 +0100 Message-ID: <1b1brfydbng85$.106aaoguop29f.dlg@40tude.net> NNTP-Posting-Date: 15 Dec 2008 14:29:57 CET NNTP-Posting-Host: eadd7fec.newsspool4.arcor-online.net X-Trace: DXC=iIocI3S145Hj7E:bke<5HF4IUKKADNcfSJ;bb[EFCTGGVUmh?DLK[5LiR>kgBSGH?OXiHN;J X-Complaints-To: usenet-abuse@arcor.de Xref: g2news2.google.com comp.lang.ada:3964 Date: 2008-12-15T14:29:57+01:00 List-Id: On Mon, 15 Dec 2008 04:13:47 -0800 (PST), Ludovic Brenta wrote: > On Dec 15, 11:21 am, "Dmitry A. Kazakov" > wrote: >> There seems one overlooked thing in the rules controlling matching formal >> packages. An instance of generic child package does not match as an >> instance of the generic parent. >> >> I mean the following: >> >> generic >> package Generic_A is >> end Generic_A; >> >> package A is new Generic_A; >> >> generic >> package Generic_A.Generic_B is >> end Generic_A.Generic_B; >> >> package AB is new A.Generic_B; >> >> generic >> with package A is new Generic_A (<>); >> package Generic_Foo is >> end Generic_Foo; >> >> package Foo is new Generic_Foo (AB); >> -- Error: AB is not an instance of Generic_A >> >> Semantically, AB being an extension of Generic_A can be considered an >> instance of. > > No, because semantically, packages are not types. They are units of > visibility. And they are orthogonal to type extension, dynamic > dispatching and object-oriented programming if that's what you have in > mind. I didn't. (For that matter the concept of type extension is questionable.) I meant exclusively visibility. A child package has parent's declaration visible in its body. package Foo is new Generic_Foo (AB); should read, "take AB or any of its parents, which is an instance of Generic_A." [ Presently it is insolvable in an implicit form, because the actual of the parent package has no name. Differently to the formal parameters, which actuals are anonymous "outside," but named "inside," parents are anonymous for all sights. ] -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de