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,1116ece181be1aea X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-09-23 18:55:55 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!headwall.stanford.edu!newshub.sdsu.edu!elnk-nf2-pas!newsfeed.earthlink.net!stamper.news.pas.earthlink.net!stamper.news.atl.earthlink.net!newsread1.news.atl.earthlink.net.POSTED!not-for-mail Sender: mheaney@MHEANEYX200 Newsgroups: comp.lang.ada Subject: Re: Is the Writing on the Wall for Ada? References: <568ede3c.0309160929.1d0d3d95@posting.google.com> <3F67AFB9.7040001@attbi.com> <3F6F0841.60607@attbi.com> <1064244399.683441@master.nyc.kbcfp.com> <3F70021A.2010305@attbi.com> <1064320198.65725@master.nyc.kbcfp.com> From: Matthew Heaney Message-ID: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Wed, 24 Sep 2003 01:55:54 GMT NNTP-Posting-Host: 65.110.133.134 X-Complaints-To: abuse@earthlink.net X-Trace: newsread1.news.atl.earthlink.net 1064368554 65.110.133.134 (Tue, 23 Sep 2003 18:55:54 PDT) NNTP-Posting-Date: Tue, 23 Sep 2003 18:55:54 PDT Organization: EarthLink Inc. -- http://www.EarthLink.net Xref: archiver1.google.com comp.lang.ada:42834 Date: 2003-09-24T01:55:54+00:00 List-Id: Hyman Rosen writes: > Oh, by the way, is it true that "virtual" methods of Ada objects can > only be procedures and not functions? Huh? Of course not: type T is abstract tagged null record; function Op (O : T) return Integer is abstract; You might be thinking of functions that return a tagged type: function Op2 return T is abstract; In the cases where there's a primitive op that returns the type, then you must override the function or the type "goes abstract." Think about this: O : T'Class := ...; begin O := Op2; -- I think that will work Here we dispatch on the return type. There are also "tag indeterminate" expressions, where the compiler figures out which function to call based on context.