From: dmitry6243@my-deja.com
Subject: Re: Common ancestor (visibility rules)
Date: 2000/03/30
Date: 2000-03-30T00:00:00+00:00 [thread overview]
Message-ID: <8bvjo3$n1k$1@nnrp1.deja.com> (raw)
In-Reply-To: 8bu64t$60h$1@nnrp1.deja.com
In article <8bu64t$60h$1@nnrp1.deja.com>,
Robert Dewar <robert_dewar@my-deja.com> wrote:
> > with A; use A; -- OK with Aonix, error in GNAT
> >(v3.12)
>
> The above is perfectly fine, and compiles fine with all versions
> of GNAT, you are either compiling code different from what
> you quoted, or you have a messed up copy of GNAT.
b-a.adb:1:13: "A" is not a usable package
> No, of course GNAT handles this right. You should perhaps
> publish the ENTIRE code you have that GNAT rejected. You
> gave two quite different examples of code so far, and
> neither had with A; use A; in it.
-------------- a.ads
package A is
procedure Foo;
end A;
-------------- b.ads
package B is
procedure A;
end B;
-------------- b.adb
package body B is
procedure A is separate;
end B;
-------------- b-a.adb
with A; use A;
separate (B)
procedure A is
begin
Foo;
end A;
===========================================
>gcc -c b-a.adb
b-a.adb:1:13: "A" is not a usable package
b-a.adb:5:04: "Foo" is not visible
b-a.adb:5:04: non-visible declaration at a.ads:2
> I will say the rule once more, after that you really need to
> read and figure it out :-)
>
> You can only WITH a library unit, library units are the units
> that are child units of Standard.
>
> So if you say
>
> with Standard.A;
>
> you are saying that Standard.A is a library unit, i.e. that
> it is a child of Standard, i.e. that its fully qualified nanme
> is Standard.Standard.A.
>
> The fully qualified name always includes Standard, but you can
> NOT use this fully qualified name in a WITH clause!
In other words:
1. Fully qualified names cannot be used in WITH clause;
2. Fully qualified names can be used in USE clause;
Here "fully qualified name" stays for a name beginning from Standard (I
mean the predefined one). As a consequence, WITH and USE clauses use
different names. This is what I meant talking about "two diffrent kinds
of names".
Had I figured it out? (:-))
P.S. You know it for sure. Does ALRM cease to exist? It worked much
better to me. I cannot find a new version, mine is dated 1992! (:-().
Regards,
Dmitry Kazakov
Sent via Deja.com http://www.deja.com/
Before you buy.
next prev parent reply other threads:[~2000-03-30 0:00 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-03-28 0:00 Common ancestor (visibility rules) dmitry6243
2000-03-28 0:00 ` Steve Folly
2000-03-28 0:00 ` Robert Dewar
2000-03-29 0:00 ` dmitry6243
2000-03-29 0:00 ` Robert Dewar
2000-03-29 0:00 ` dmitry6243
2000-03-30 0:00 ` Robert Dewar
2000-03-30 0:00 ` dmitry6243 [this message]
2000-03-30 0:00 ` Tucker Taft
2000-03-31 0:00 ` dmitry6243
2000-04-01 0:00 ` Robert Dewar
2000-04-01 0:00 ` Robert Dewar
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox