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,dbcfe2b0a74da57e X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!postnews.google.com!19g2000hsx.googlegroups.com!not-for-mail From: Ludovic Brenta Newsgroups: comp.lang.ada Subject: Re: Inherited Methods and such Date: Mon, 17 Sep 2007 08:11:48 -0700 Organization: http://groups.google.com Message-ID: <1190041908.492024.263110@19g2000hsx.googlegroups.com> References: <1190039166.449906.15070@g4g2000hsf.googlegroups.com> NNTP-Posting-Host: 32.58.34.227 Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-Trace: posting.google.com 1190041908 7453 127.0.0.1 (17 Sep 2007 15:11:48 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Mon, 17 Sep 2007 15:11:48 +0000 (UTC) In-Reply-To: <1190039166.449906.15070@g4g2000hsf.googlegroups.com> User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.1) Gecko/20061204 Firefox/2.0.0.1,gzip(gfe),gzip(gfe) X-HTTP-Via: 1.1 SEVPXS01 Complaints-To: groups-abuse@google.com Injection-Info: 19g2000hsx.googlegroups.com; posting-host=32.58.34.227; posting-account=ps2QrAMAAAA6_jCuRt2JEIpn5Otqf_w0 Xref: g2news2.google.com comp.lang.ada:1984 Date: 2007-09-17T08:11:48-07:00 List-Id: Shaun Patterson wrote: > I'm trying to get sub-packages to override superclass methods. Packages are not classes. IIUC, what you want is dynamic dispatching: Base.Do should call whichever version of Test_1 and Test_2 is applicable for the current invocation. In Ada, you get dynamic dispatching by combining tagged types and primitive operations on these types. See http://en.wikibooks.org/wiki/Ada_Programming/Object_Orientation If you come from C++: class -> tagged type * -> class namespace -> package (very roughly) virtual method -> primitive operation static method -> class-wide operation In Ada, a "class" is the set consisting of a tagged type and all types derived from it. HTH -- Ludovic Brenta.