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=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI autolearn=unavailable autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,b18c1bcb7f0031e7 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-08-25 07:28:34 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!proxad.net!usenet-fr.net!enst.fr!not-for-mail From: "Robert C. Leif" Newsgroups: comp.lang.ada Subject: RE: simulate inheritance with generic package Date: Mon, 25 Aug 2003 07:25:38 -0700 Organization: ENST, France Message-ID: NNTP-Posting-Host: marvin.enst.fr Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: avanie.enst.fr 1061821616 5941 137.194.161.2 (25 Aug 2003 14:26:55 GMT) X-Complaints-To: usenet@enst.fr NNTP-Posting-Date: Mon, 25 Aug 2003 14:26:55 +0000 (UTC) To: "'WATANABE Katsuhiro'" , "Comp. Lang. Ada" Return-Path: X-Mailer: Microsoft Office Outlook, Build 11.0.5329 Thread-Index: AcNqy1ssu0ve7ycuR2yrgXify/svzQABtFeQ In-Reply-To: X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-BeenThere: comp.lang.ada@ada.eu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: comp.lang.ada mail to news gateway List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Xref: archiver1.google.com comp.lang.ada:41846 Date: 2003-08-25T07:25:38-07:00 You can also create generic types and objects for the fields of a tagged record that is contained in a generic package. In Ada it is not generic or tagged; they can be combined to serve as an excellent model for real-world objects. Unfortunately, it is not obvious how to handle a record's tag when creating a representation specification of hardware, such as a register or memory address. Bob Leif Robert C. Leif, Ph.D. Email rleif@rleif.com -----Original Message----- From: WATANABE Katsuhiro [mailto:katsu@watanabe.name] Sent: Sunday, August 24, 2003 6:25 PM To: comp.lang.ada@ada.eu.org Subject: simulate inheritance with generic package 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 instantiation 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