comp.lang.ada
 help / color / mirror / Atom feed
From: "Robert I. Eachus" <rieachus@comcast.net>
Subject: Re: How to test object hierarchy
Date: Sat, 20 Dec 2003 13:20:20 -0500
Date: 2003-12-20T13:20:20-05:00	[thread overview]
Message-ID: <06idnS2-ndV7D3miRVn-hQ@comcast.com> (raw)
In-Reply-To: <wcck74sv17i.fsf@shell01.TheWorld.com>

Robert A Duff wrote:

> Yes, it can be instance.  It can also be a renaming.
...
> I didn't follow the entire discussion, but yes, I think that could work.

Before somebody gets bent all out of shape trying to implement the idea, 
there is a subtle gotcha here that has to be avoided.  It is often 
difficult (but not impossible) to define the generic you want before the 
freezing point.

There are two workarounds, which often occur naturally.  The first is to 
make the signature of the subprogram dispatching.  Then in the body, 
implement the subprogram as a generic instance.  Or you can make the 
generic an operation of a parent type, so that the generic instantiation 
can appear before the freezing point of the child type, but after the 
freezing point of the parent.

As I said, you may naturally not run into a problem.  Depends on how you 
define the generic and other things.  But if you do have a problem, move 
the instantiation to the body of the package that defines the type.

-- 
                                           Robert I. Eachus

"The war on terror is a different kind of war, waged capture by capture, 
cell by cell, and victory by victory. Our security is assured by our 
perseverance and by our sure belief in the success of liberty." -- 
George W. Bush




  reply	other threads:[~2003-12-20 18:20 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 [this message]
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