comp.lang.ada
 help / color / mirror / Atom feed
From: Marc.Graham@SEI.CMU.EDU
Subject: Expanded names
Date: 24 Sep 90 18:14:09 GMT	[thread overview]
Message-ID: <9009241814.AA08734@bx.sei.cmu.edu> (raw)


The following Ada code compiles cleanly and produces the output
"Inner". Question: Is there any way that the outer outer_constant may
be named from the inner testnames? If no, then why is 4.1.3 rule f (in
particular, para 18 and 19) worded the way it is? (Note: if the outer
testnames were a procedure, rather than a package, the expanded name
testnames.outer_context is illegal within the inner testnames.)
------------------------------------------------------------
package testnames is
    procedure testnames (outer_constant : integer);
end testnames;
with text_io; use text_io;
package body testnames is

    outer_constant : constant := 3.14159;
    
    procedure testnames (outer_constant : integer) is
    begin
    if testnames.outer_constant > 2 then
    	put_line("Outer!");
    else
    	put_line("Inner");
    end if;
    end testnames;
end testnames;
with testnames;
procedure exectest is
begin
    testnames.testnames(1);
end exectest;
------------------------------------------------------------

Marc H. Graham                    Software Engineering Institute
marc@sei.cmu.edu                  Carnegie Mellon University
(412) 268 7784                    Pittsburgh, PA   15213
                   

             reply	other threads:[~1990-09-24 18:14 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1990-09-24 18:14 Marc.Graham [this message]
1990-09-25  8:27 ` Expanded names Dik T. Winter
1990-10-01 19:49   ` Robert I. Eachus
  -- strict thread matches above, loose matches on Subject: below --
1990-09-26 16:57 "Norman H. Cohen"
replies disabled

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