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=ham 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: g2news1.google.com!postnews.google.com!s1g2000prg.googlegroups.com!not-for-mail From: Ludovic Brenta Newsgroups: comp.lang.ada Subject: Re: A proposal for formal packages matching Date: Mon, 15 Dec 2008 04:13:47 -0800 (PST) Organization: http://groups.google.com Message-ID: References: NNTP-Posting-Host: 153.98.68.197 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: posting.google.com 1229343227 15333 127.0.0.1 (15 Dec 2008 12:13:47 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Mon, 15 Dec 2008 12:13:47 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: s1g2000prg.googlegroups.com; posting-host=153.98.68.197; posting-account=pcLQNgkAAAD9TrXkhkIgiY6-MDtJjIlC User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.8.0.12) Gecko/20070718 Red Hat/1.5.0.12-3.el5 Firefox/1.5.0.12,gzip(gfe),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:2990 Date: 2008-12-15T04:13:47-08:00 List-Id: 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. -- Ludovic Brenta.