comp.lang.ada
 help / color / mirror / Atom feed
From: Simon Wright <simon@pogner.demon.co.uk>
Subject: Re: How do I get this to work??
Date: 1999/01/08
Date: 1999-01-08T00:00:00+00:00	[thread overview]
Message-ID: <x7vpv8qs21k.fsf@pogner.demon.co.uk> (raw)
In-Reply-To: uhfu2bzmo.fsf@gsfc.nasa.gov

Stephen Leake <Stephen.Leake@gsfc.nasa.gov> writes:

> I agree with the other comments here; the bad taste is from not
> knowing what will happen to the pointer when you pass it to C. That's
> why it is "unchecked".

Not just to C! for example, in the Booch Components, I have

  procedure Create_Arc (G : in out Undirected_Graph;
                        A : in out Undirected_Arc'Class;
                        I : Arc_Item;
                        First : in out Undirected_Vertex'Class;
                        Second : in out Undirected_Vertex'Class) is
  begin
    Clear (A);
    A.Rep := new Arc_Node'(Ada.Finalization.Controlled with
                           Item => I,
                           Enclosing => G'Unchecked_Access, -- <<<<<<<<<<<<<<<<
                           From => First.Rep,
                           To => Second.Rep,
                           Next_Incoming => null,
                           Next_Outgoing => null,
                           Count => 1);

and the Unchecked_Access is needed because (I suppose) you can't tell
at compile time what the scope of the actual for G is. It would
certainly be possible (though unnatural) to use this code with the
scope of the actual G being less than that of the actual A .. hmm, I
guess there's a warning-to-users needed there ..




  reply	other threads:[~1999-01-08  0:00 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-01-04  0:00 How do I get this to work?? Chris Warwick
1999-01-05  0:00 ` Tom Moran
1999-01-05  0:00 ` Chris Warwick
1999-01-05  0:00   ` Stephen Leake
1999-01-05  0:00     ` Tom Moran
1999-01-06  0:00       ` robert_dewar
1999-01-06  0:00         ` Tom Moran
1999-01-07  0:00           ` robert_dewar
1999-01-07  0:00             ` Tom Moran
1999-01-10  0:00               ` robert_dewar
1999-01-06  0:00         ` Larry Kilgallen
1999-01-06  0:00           ` Tom Moran
1999-01-06  0:00         ` Tom Moran
1999-01-07  0:00           ` robert_dewar
1999-01-07  0:00             ` Tom Moran
1999-01-10  0:00               ` robert_dewar
1999-01-10  0:00                 ` Tom Moran
1999-01-10  0:00                   ` robert_dewar
1999-01-10  0:00                   ` robert_dewar
1999-01-10  0:00                     ` Pat Rogers
1999-01-10  0:00                     ` Tom Moran
1999-01-06  0:00     ` robert_dewar
1999-01-06  0:00     ` Chris Warwick
1999-01-06  0:00       ` Tom Moran
1999-01-07  0:00       ` robert_dewar
1999-01-09  0:00         ` Chris Warwick
1999-01-09  0:00           ` Brian Rogoff
1999-01-10  0:00             ` Matthew Heaney
1999-01-09  0:00           ` Simon Wright
1999-01-10  0:00             ` robert_dewar
1999-01-11  0:00               ` Simon Wright
1999-01-16  0:00               ` Chris Warwick
1999-01-16  0:00                 ` Simon Wright
1999-01-16  0:00                 ` robert_dewar
1999-01-18  0:00                   ` Chris Warwick
1999-01-18  0:00                     ` Matthew Heaney
1999-01-16  0:00                 ` Matthew Heaney
1999-01-16  0:00                   ` robert_dewar
1999-01-18  0:00                   ` Chris Warwick
1999-01-18  0:00                     ` dennison
1999-01-18  0:00                     ` robert_dewar
1999-01-18  0:00                       ` dennison
1999-01-18  0:00                       ` Tucker Taft
1999-01-19  0:00                         ` Chris Warwick
1999-01-19  0:00                           ` robert_dewar
1999-01-20  0:00                             ` Jeff Carter
1999-01-20  0:00                               ` robert_dewar
1999-01-21  0:00                                 ` Chris Warwick
1999-01-19  0:00                           ` Stephen Leake
1999-01-19  0:00                           ` Tom Moran
1999-01-18  0:00                     ` Matthew Heaney
1999-01-07  0:00       ` Stephen Leake
1999-01-08  0:00         ` Simon Wright [this message]
1999-01-06  0:00   ` Simon Wright
1999-01-22  0:00   ` 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