comp.lang.ada
 help / color / mirror / Atom feed
From: Nick Roberts <nick.roberts@acm.org>
Subject: Re: How to test object hierarchy
Date: Fri, 19 Dec 2003 17:24:12 +0000
Date: 2003-12-19T17:24:12+00:00	[thread overview]
Message-ID: <brvc83$835l9$1@ID-25716.news.uni-berlin.de> (raw)
In-Reply-To: <93172edb.0312181024.9a536b2@posting.google.com>

Pierre Favier wrote:

> 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. In short, I am
> trying to run something like the following code which does not compile
> because the Class attribute applies to types or subtypes but not to
> objects ...
> 
> Any suggestions on how to achieve the intended effect?

I feel this is a bit like someone asking how to scratch his ear with his
foot. I suspect the most sensible answer might be "Don't do that."

Since, within the procedure Test_Hierarchy, the only operations available
for either Obj1 or Obj2 are the operations of the type Root_Object, how can
it be of any significance to the code inside this procedure what relation
(deeper in the hierarchy) the objects have to each other? Surely the code
inside the procedure sees only two objects which obey the interface of
Root_Object?

I would guess, therefore, that there is an error of logic (or perhaps of
style) in your program, but if you think not then by all means please give
more details of what you are really trying to do.

-- 
Nick Roberts
  __________________________________________________________
|  Fight Spam! Join EuroCAUCE: http://www.euro.cauce.org/  |
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~




      parent reply	other threads:[~2003-12-19 17:24 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
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 [this message]
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox