From: bobduff@world.std.com (Robert A Duff)
Subject: Re: Which compiler is correct?
Date: 1997/06/21
Date: 1997-06-21T00:00:00+00:00 [thread overview]
Message-ID: <EC3tGJ.F0A@world.std.com> (raw)
In-Reply-To: x7vyb86jpr2.fsf@pogner.demon.co.uk
In article <x7vyb86jpr2.fsf@pogner.demon.co.uk>,
Simon Wright <simon@pogner.demon.co.uk> wrote:
>a.c's body can see the full view of type a.x
>a.c's body can only see the partial view of type a.b.y
>the partial view of type a.b.y says it's a new a.x
>so how come the a.x bits of a.b.y aren't visible to a.c's body?
Because the RM says so. ;-)
>(I'm sure it's true if you say so; I just think most people, after
>they've seen this sort of problem and fumbled their way to a
>resolution a few times, will have a private spellbook from which they
>will select incantations until they find one that works. So what's
>new, you say)
The idea here, is that when you say "type New_Type is new Old_Type ...",
the properties of New_Type are frozen at that point. EXCEPT when this
declaration is inside where Old_Type is declared -- then, at the
earliest place within New_Type's immediate scope where it can see some
additional information about Old_Type, then that information becomes
visible for New_Type. Usually, this doesn't happen. When it does
happen, it's either at the beginning of a private part of a child
package, or at the beginning of the body of a physically-nested package.
Yes, this leads to surprising consequences, like where you're at a place
that *knows* New_Type is derived from Old_Type, and *knows* that
Old_Type has a component Foo, but nonetheless, Foo is not a visible
component of New_Type.
This can be confusing, but at least the confusion happens at compile
time, not at run time. :-)
- Bob
next prev parent reply other threads:[~1997-06-21 0:00 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
1997-06-17 0:00 Which compiler is correct? Tom Moran
1997-06-18 0:00 ` Robert A Duff
1997-06-18 0:00 ` John Woodruff
1997-06-19 0:00 ` Robert A Duff
1997-06-20 0:00 ` Jon S Anthony
1997-06-21 0:00 ` Robert A Duff
1997-06-26 0:00 ` Jon S Anthony
1997-06-19 0:00 ` Simon Wright
1997-06-20 0:00 ` Jon S Anthony
1997-06-21 0:00 ` Robert A Duff
1997-06-21 0:00 ` Robert A Duff [this message]
1997-06-21 0:00 ` Simon Wright
1997-06-23 0:00 ` Mats.Weber
1997-06-24 0:00 ` Jon S Anthony
1997-06-18 0:00 ` Pascal Obry
1997-06-18 0:00 ` Tom Moran
-- strict thread matches above, loose matches on Subject: below --
1996-09-10 0:00 Which compiler is correct?? Robert B. Love
1996-09-10 0:00 ` Robert Dewar
1996-09-11 0:00 ` Robert B. Love
1996-09-10 0:00 ` Robert Dewar
1996-09-11 0:00 ` Robert A Duff
1996-09-12 0:00 ` Ken Cowan
1996-09-12 0:00 ` Ken Cowan
1996-09-13 0:00 ` Jon S Anthony
1996-09-11 0:00 ` Jon S Anthony
1996-09-12 0:00 ` Tucker Taft
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox