comp.lang.ada
 help / color / mirror / Atom feed
From: "Jean-Pierre Rosen" <rosen@adalog.fr>
Subject: Re: Compiler complaint legal?
Date: Wed, 20 Jun 2001 20:02:46 +0200
Date: 2001-06-20T20:02:46+02:00	[thread overview]
Message-ID: <9gqogs$iii$1@s1.read.news.oleane.net> (raw)
In-Reply-To: Lo5Y6.2832$yp1.84754@www.newsranger.com

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1233 bytes --]

"Ted Dennison" <dennison@telepath.com> a �crit dans le message news: Lo5Y6.2832$yp1.84754@www.newsranger.com...
> In article <mailman.993057563.10765.comp.lang.ada@ada.eu.org>, M. A. Alves
> says...
> >
> >Package O defines type O.  GNAT does not recognize the type here:
> >
> >with O; use O;
> >procedure O_Test is
> >  Object: O; -- HERE
>
> I don't believe you can have packages and types with the same name in the same
> scope. Under the circumstances, I'd want to keep the package name.
Yes you can. However, the main rule is that something is use-visible only if it does not conflict with a name that would be
otherwise visible.
Therefore, O designates the package (which is directly visible) and not the type (which is only use-visible).

> You should probably aviod naming things the same as their enclosing package.
Certainly

>On
> the other hand, this is yet another reason to aviod the use clause.
Certainly not. The use clause has no effect in that case: when there is any risk of ambiguity, it nicely steps back. The "O" is the
same if there were no use clause.

--
---------------------------------------------------------
           J-P. Rosen (rosen@adalog.fr)
Visit Adalog's web site at http://www.adalog.fr





  reply	other threads:[~2001-06-20 18:02 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-06-20 18:17 Compiler complaint legal? M. A. Alves
2001-06-20 17:51 ` Ted Dennison
2001-06-20 18:02   ` Jean-Pierre Rosen [this message]
2001-06-20 21:33 ` Robert A Duff
2001-06-21 23:40 ` Jeff Creem
replies disabled

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