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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,b18c1bcb7f0031e7,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-08-24 18:25:26 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.media.kyoto-u.ac.jp!newsfeed.gol.com!giga-nspixp2!news-gw1.ocn.ad.jp!news-gw2.ocn.ad.jp!news-est.ocn.ad.jp!not-for-mail From: WATANABE Katsuhiro Newsgroups: comp.lang.ada Subject: simulate inheritance with generic package Date: 25 Aug 2003 10:25:23 +0900 Organization: An individual person. Sender: katsu@FLAGSHIP Message-ID: NNTP-Posting-Host: p8173-ipad02aobadori.miyagi.ocn.ne.jp Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: newsnn-itk01p.noc-otehonkan.ocn.ad.jp 1061774722 6465 219.160.45.173 (25 Aug 2003 01:25:22 GMT) X-Complaints-To: usenet@ocn.ad.jp NNTP-Posting-Date: Mon, 25 Aug 2003 01:25:22 +0000 (UTC) User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Xref: archiver1.google.com comp.lang.ada:41830 Date: 2003-08-25T10:25:23+09:00 List-Id: I'd like to know how to simulate inheritance in OO with generic package in classic Ada, which has no tagged type. An ancient OO book(*) instructs a way of inheritance implementation in Ada by introducing has-a reference from child class to parent class. And it says their functions should be linked, that is to say, any call to the child instance must be delegated to the parent instance. And the description goes on as follows: > If you use generic package this linkage can be made > by using a specific routine as the relevant (generic) > parameter when instantiating the package. But, what does 'a specific routine' means? As I am a Smalltalk programmer, I have limited knowledge on Ada and its instanciation mechanism of generic package. So, I'd appreciate your help showing concretely what 'a specific routine' is. (*) Ivar Jacobson; Object-Oriented Software Engineering --- A Use Case Driven Approach ---; Addison-Wesley; 1994 -- WATANABE Katsuhiro