Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!ucbvax!SEI.CMU.EDU!Marc.Graham From: Marc.Graham@SEI.CMU.EDU Newsgroups: comp.lang.ada Subject: Expanded names Message-ID: <9009241814.AA08734@bx.sei.cmu.edu> Date: 24 Sep 90 18:14:09 GMT Sender: daemon@ucbvax.BERKELEY.EDU Organization: The Internet Lines: 36 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