comp.lang.ada
 help / color / mirror / Atom feed
* Package name duplication in Hierachical Libraries
@ 2002-01-02 10:51 Stuart Forster
  2002-01-02 12:52 ` Florian Weimer
  2002-01-04 14:11 ` Stephen Leake
  0 siblings, 2 replies; 3+ messages in thread
From: Stuart Forster @ 2002-01-02 10:51 UTC (permalink / raw)


I have a problem with duplicated package names in hierarchical libraries.

The example below results in an infinite recursion of B.A.C where I was
hoping for

>Test
B.A.C
A.C
>

Is this the correct behaviour?

I've only tried it on gnat 3.13p.

package A is
   procedure C;
end A;

with Text_IO;
package body A is
   procedure C is
   begin
      Text_IO.Put_Line("A.C");
   end C;
end A;

package B is
end B;

package B.A is
   procedure C;
end B.A;

with A;
with Text_IO;
package body B.A is
   procedure C is
   begin
      Text_IO.Put_Line("B.A.C");
      A.C;                                    -- Instead of calling A.C
calls B.A.C.
   end C;
end B.A;

with B.A;
procedure Test is
begin
   B.A.C;
end Test;






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

* Re: Package name duplication in Hierachical Libraries
  2002-01-02 10:51 Package name duplication in Hierachical Libraries Stuart Forster
@ 2002-01-02 12:52 ` Florian Weimer
  2002-01-04 14:11 ` Stephen Leake
  1 sibling, 0 replies; 3+ messages in thread
From: Florian Weimer @ 2002-01-02 12:52 UTC (permalink / raw)


"Stuart Forster" <stuart.forster@baesystems.com> writes:

> I have a problem with duplicated package names in hierarchical libraries.
>
> The example below results in an infinite recursion of B.A.C where I was
> hoping for
>
>>Test
> B.A.C
> A.C
>>
>
> Is this the correct behaviour?

Yes, I think so.  You can use Standard.A.C to refer to the other
package.



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

* Re: Package name duplication in Hierachical Libraries
  2002-01-02 10:51 Package name duplication in Hierachical Libraries Stuart Forster
  2002-01-02 12:52 ` Florian Weimer
@ 2002-01-04 14:11 ` Stephen Leake
  1 sibling, 0 replies; 3+ messages in thread
From: Stephen Leake @ 2002-01-04 14:11 UTC (permalink / raw)


"Stuart Forster" <stuart.forster@baesystems.com> writes:

> I have a problem with duplicated package names in hierarchical libraries.
> 
> The example below results in an infinite recursion of B.A.C where I was
> hoping for
> 
> >Test
> B.A.C
> A.C
> >
> 
> Is this the correct behaviour?

Yes, the compiler is doing what you told it to do.

Within package "B", the name "A.C" refers to "B.A.C". To get the one
you want, use "Standard.A.C".

> <snip code> 

-- 
-- Stephe



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

end of thread, other threads:[~2002-01-04 14:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-01-02 10:51 Package name duplication in Hierachical Libraries Stuart Forster
2002-01-02 12:52 ` Florian Weimer
2002-01-04 14:11 ` Stephen Leake

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