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.1 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM,HK_RANDOM_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,93553f5160def2e9,start X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!postnews.google.com!v45g2000cwv.googlegroups.com!not-for-mail From: pnkflyd831@gmail.com Newsgroups: comp.lang.ada Subject: 2 Ada 95/05 language design questions Date: 15 Feb 2007 08:21:48 -0800 Organization: http://groups.google.com Message-ID: <1171556508.585271.80780@v45g2000cwv.googlegroups.com> NNTP-Posting-Host: 63.164.202.130 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: posting.google.com 1171556524 24062 127.0.0.1 (15 Feb 2007 16:22:04 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Thu, 15 Feb 2007 16:22:04 +0000 (UTC) User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8.0.9) Gecko/20061206 Firefox/1.5.0.9,gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: v45g2000cwv.googlegroups.com; posting-host=63.164.202.130; posting-account=E0hQbAwAAAD2FlvvQq_2SWp8Ek2yl3o- Xref: g2news2.google.com comp.lang.ada:9339 Date: 2007-02-15T08:21:48-08:00 List-Id: I find Ada to be an excellent embedded, real-time, OO language. However I've noticed over the course of my 3 years programming with the language 2 ways in which the language behaves that I question the designers on their rationale. The first question deals with the decision not to allow the declaration of abstract subprograms within the private part of a package (that contains a public abstract tagged type, and uses it as the controlling operand). See Ada 05 LRM section 3.9.3(10). The Annotated LRM gives a rational (derived tagged types not declared in child packages would not have visibility to these abstract subprograms), but wouldn't the better option to be to force derived tagged type to be declared in the same or child packages than to have to make public the abstract subprogram? I do not like the idea of allowing external objects access to methods that could potentially leave the aforementioned class objects in an inconsistant state. (Attempts to impliment the Template Method design pattern suffer from this issue) The second question deals with the decision not to have derived tagged types inherit the "primitive" classwide subprograms of their publicly declared parents. See Ada 05 LRM section 3.4(16,17/2, & 23/2) which states that only primitive operations are inherited and made visible. In Ada 95 it seems silly to have to with in the package where the classwide subprogram is declared to use it, and then the package reference has to be repeated every time the classwide subprogram is called unless a use clause is present. The calling object should not have to distinguish between dispatching and classwide operations when they have a child derived type view of the object. In Ada 05, the impact is less severe because of the dot notation, but I am still curious as to why the decision was made. (Code which works with the child derived type object instead of the parent view of the object suffer from this issue).