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,760a0492b97ae06e X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-12-18 23:45:45 PST Path: archiver1.google.com!postnews1.google.com!not-for-mail From: favierp@sofreavia.fr (Pierre Favier) Newsgroups: comp.lang.ada Subject: Re: How to test object hierarchy Date: 18 Dec 2003 23:45:44 -0800 Organization: http://groups.google.com Message-ID: <93172edb.0312182345.3d454151@posting.google.com> References: <93172edb.0312181024.9a536b2@posting.google.com> NNTP-Posting-Host: 81.80.132.20 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1071819945 31848 127.0.0.1 (19 Dec 2003 07:45:45 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Fri, 19 Dec 2003 07:45:45 +0000 (UTC) Xref: archiver1.google.com comp.lang.ada:3547 Date: 2003-12-18T23:45:44-08:00 List-Id: Stephen Leake wrote in message news:... > favierp@sofreavia.fr (Pierre Favier) writes: > > > I am wondering how to test for two objects which types both derive from a > > common root type if one of them derives from the other. > > Interesting. Here's one way: > > ...... > > It does seem like you aught to be able to do this without string operations. Yes. I had thought of using tag's Expanded_Name like you suggested but was wondering whether there was a language feature that I was overlooking. If you look at spec of package Ada.Tags in GNAT you see the following function in the private part of the spec: function CW_Membership (Obj_Tag : Tag; Typ_Tag : Tag) return Boolean; -- Given the tag of an object and the tag associated to a type, return -- true if Obj is in Typ'Class. which could be used as is for two object tags instead of an object tag and a type tag. Why not make it public? Is any addition of this sort planned for Ada 200X?