From: favierp@sofreavia.fr (Pierre Favier)
Subject: Re: How to test object hierarchy
Date: 18 Dec 2003 23:45:44 -0800
Date: 2003-12-18T23:45:44-08:00 [thread overview]
Message-ID: <93172edb.0312182345.3d454151@posting.google.com> (raw)
In-Reply-To: mailman.138.1071792945.31149.comp.lang.ada@ada-france.org
Stephen Leake <stephen_leake@acm.org> wrote in message news:<mailman.138.1071792945.31149.comp.lang.ada@ada-france.org>...
> 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?
next prev parent reply other threads:[~2003-12-19 7:45 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-12-18 18:24 How to test object hierarchy Pierre Favier
2003-12-19 0:15 ` Stephen Leake
2003-12-19 7:45 ` Pierre Favier [this message]
2003-12-19 10:53 ` Dmitry A. Kazakov
2003-12-19 14:35 ` Hyman Rosen
2003-12-19 17:07 ` Dmitry A. Kazakov
2003-12-19 23:26 ` Robert A Duff
2003-12-20 18:20 ` Robert I. Eachus
2003-12-19 17:25 ` Georg Bauhaus
2003-12-20 11:13 ` Dmitry A. Kazakov
2003-12-21 4:34 ` Georg Bauhaus
2003-12-21 13:43 ` Dmitry A. Kazakov
2003-12-21 19:58 ` Dmytry Lavrov
2003-12-22 1:19 ` Robert I. Eachus
2003-12-22 10:09 ` Dmitry A. Kazakov
2003-12-22 17:33 ` Robert I. Eachus
2003-12-23 10:49 ` Dmitry A. Kazakov
2003-12-22 10:05 ` Dmitry A. Kazakov
2003-12-19 17:24 ` Nick Roberts
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox