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: a07f3367d7,158ce2376534c35d X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!feeder1.cambriumusenet.nl!feed.tweaknews.nl!193.201.147.78.MISMATCH!feeder.news-service.com!newsfeed.straub-nv.de!uucp.gnuu.de!newsfeed.arcor.de!newsspool3.arcor-online.net!news.arcor.de.POSTED!not-for-mail Date: Thu, 07 Jul 2011 16:09:58 +0200 From: Georg Bauhaus User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.18) Gecko/20110616 Thunderbird/3.1.11 MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Derived private interface References: <27656578-65aa-48b9-9f89-4ebd4e0cb02a@glegroupsg2000goo.googlegroups.com> <0fe3b0f8-c064-444d-899d-640e891b58c3@w4g2000yqm.googlegroups.com> <128d8eb5-1cc6-47e3-a09b-b53a5ef289ce@m10g2000yqd.googlegroups.com> <4e141501$0$6629$9b4e6d93@newsspool2.arcor-online.net> <4b2728fc-6127-45d8-a314-9fc491701c26@g12g2000yqd.googlegroups.com> <4e145c3a$0$6542$9b4e6d93@newsspool4.arcor-online.net> <4e14dc0c$0$6565$9b4e6d93@newsspool3.arcor-online.net> <425f89e6-8c77-4615-a717-f6991ca63b65@v12g2000vby.googlegroups.com> In-Reply-To: <425f89e6-8c77-4615-a717-f6991ca63b65@v12g2000vby.googlegroups.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Message-ID: <4e15be36$0$6556$9b4e6d93@newsspool4.arcor-online.net> Organization: Arcor NNTP-Posting-Date: 07 Jul 2011 16:09:58 CEST NNTP-Posting-Host: 05cb3fbf.newsspool4.arcor-online.net X-Trace: DXC=I@VUd139kZRV0Pe9PRnbJ\4IUKZLh>_cHTX3j]_kNk=9^NXFU X-Complaints-To: usenet-abuse@arcor.de Xref: g2news1.google.com comp.lang.ada:20117 Date: 2011-07-07T16:09:58+02:00 List-Id: On 07.07.11 01:56, Adam Beneschan wrote: > (3) in the complex case where > visibility rules cause an inherited operation to disappear, then > you'll have to figure out what's going on. Case #3 is the difficult > one. Yes, and either way, I think I'll have to think about complex issues in case #3, with or without indicators, insofar as either issue (backwards or forwards) will point to the same things. Should an issue arise. But point taken, every hint from the compiler is welcome, the better hint wins. I guess I'm uneasy with indicators (which I use) because they purport to solve some problem, but this is just accidental, and ad hoc, and incomplete in several dimensions. Maybe something better is still possible. If indicators are about doing Ada inheritance properly, here is an alternative. (That's likely a bold attempt, but anyway.) Like "overriding", it restricts the language's assistence to just tagged types. Instead of adding all indicators, have the programmer explicitly mention each operation. Let T0 = ({...}, {Op1, ..., OpN}), then deriving T1 from T0 will list all operations {Op1, ..., OpN}. (Tools will help the lazy writer.) For N=2: type T0 is abstract tagged private; procedure Op1 (X : in out T0) is abstract; procedure Op2 (X : in out T0) is abstract; Then, type T1 is abstract new T0 with private; procedure Op1 (X : in out T1) is <>; -- abstract procedure Op2 (X : in out T1); -- overriding procedure Op3 (X : in out T1); -- DC type T2 is new T1 with private; procedure Op1 (X : in out T2); -- overriding procedure Op2 (X : in out T2) is <>; -- inheriting procedure Op3 (X : in out T2); -- overriding procedure Op4 (X : in out T2); -- DC Remove T0's Op2. Then, T1 and T2 will have a dispatching operation that no longer overrides their parent's. Bad? Add Op17 to T1. T2 will become invalid because it does not list Op17. (Fix is to list Op17 using "is <>".) Add Op3 to T0. T1's Op3 then becomes overriding. Bad? Misspelling T2's Op2 renders T2 invalid (because all names of T1 have to be listed and Op2 will not be listed). A call on an object of type T2 cannot "by accident" resolve to a call on T1's. Eiffel has something similar. A class inheriting from other classes will list the features (operations) that it is going to redefine (override).