comp.lang.ada
 help / color / mirror / Atom feed
* Re: mini-quiz
  1994-12-15 20:42 mini-quiz Oliver Kellogg
@ 1994-12-15 18:59 ` Robert I. Eachus
  1994-12-19 20:31 ` mini-quiz Kevin Weise
  1 sibling, 0 replies; 3+ messages in thread
From: Robert I. Eachus @ 1994-12-15 18:59 UTC (permalink / raw)


In article <3cq9nh$5v2@salyko.cube.net> okellogg@cube.net (Oliver Kellogg) writes:

    Since packages are not overloadable, the inner Pkg hides the outer
one.  (Types are also not overloadable, but that doesn't matter here.)
For Ada 83, try paragraph 8.3(15). For Ada 95, the answer is in 8.3 as
well, but it is spread into several different paragraphs.

    Do I get full credit?


					Robert I. Eachus

with Standard_Disclaimer;
use  Standard_Disclaimer;
function Message (Text: in Clever_Ideas) return Better_Ideas is...
--

					Robert I. Eachus

with Standard_Disclaimer;
use  Standard_Disclaimer;
function Message (Text: in Clever_Ideas) return Better_Ideas is...



^ permalink raw reply	[flat|nested] 3+ messages in thread

* mini-quiz
@ 1994-12-15 20:42 Oliver Kellogg
  1994-12-15 18:59 ` mini-quiz Robert I. Eachus
  1994-12-19 20:31 ` mini-quiz Kevin Weise
  0 siblings, 2 replies; 3+ messages in thread
From: Oliver Kellogg @ 1994-12-15 20:42 UTC (permalink / raw)


package Pkg is
   type Typ is (eins, zwei);
end Pkg;

with Pkg;
package Test is
   package Pkg is
      type Typ is (un, deux);
   end Pkg;
   X : Pkg.Typ;
end Test;

--Quick, without compiling (-: Of which type is X, Pkg.Typ, or Test.Pkg.Typ ?
--Bonus question: Where in the LRM ('83 or '95) is this documented ?

-- Oliver M. Kellogg | mail: okellogg@cube.net | fax: (+49)89-60723732 --
-- Dept. RST13, Deutsche Aerospace AG, P.O. Box 801169, D-81663 Munich --




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: mini-quiz
  1994-12-15 20:42 mini-quiz Oliver Kellogg
  1994-12-15 18:59 ` mini-quiz Robert I. Eachus
@ 1994-12-19 20:31 ` Kevin Weise
  1 sibling, 0 replies; 3+ messages in thread
From: Kevin Weise @ 1994-12-19 20:31 UTC (permalink / raw)


In article <3cq9nh$5v2@salyko.cube.net>,
Oliver Kellogg <okellogg@cube.net> wrote:
>package Pkg is
>   type Typ is (eins, zwei);
>end Pkg;
>
>with Pkg;
>package Test is
>   package Pkg is
>      type Typ is (un, deux);
>   end Pkg;
>   X : Pkg.Typ;
>end Test;
>
>--Quick, without compiling (-: Of which type is X, Pkg.Typ, or Test.Pkg.Typ ?

X is of type Test.Pkg.Type.  This is because the identifier for the 
nested package Pkg is a homonym of the library package Pkg identifier,
and being an inner declaration, hides the library unit identifier.

>--Bonus question: Where in the LRM ('83 or '95) is this documented ?

Ada83, Ch. 8.3 (Visibility), paragraphs 14, 15, and 21.

>
>-- Oliver M. Kellogg | mail: okellogg@cube.net | fax: (+49)89-60723732 --
>-- Dept. RST13, Deutsche Aerospace AG, P.O. Box 801169, D-81663 Munich --
>

----------------------------------------------------------------
Kevin J. Weise			weisek@source.asset.com
COLSA Corporation		Voice - (205) 922-1512 ext. 2115
6726 Odyssey Drive		FAX   - (205) 971-0002
Huntsville, AL  35806
{Standard Disclaimers about my opinions & my employer's opinions}
{... which are in conflict often enough}
----------------------------------------------------------------
"Admire those who seek the truth;
  avoid those who find it."		Marcel Proust





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~1994-12-19 20:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1994-12-15 20:42 mini-quiz Oliver Kellogg
1994-12-15 18:59 ` mini-quiz Robert I. Eachus
1994-12-19 20:31 ` mini-quiz Kevin Weise

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