comp.lang.ada
 help / color / mirror / Atom feed
From: "Pat Rogers" <progers@NOclasswideSPAM.com>
Subject: Re: Redefining Integer Type ...
Date: 2000/10/18
Date: 2000-10-18T00:00:00+00:00	[thread overview]
Message-ID: <9viH5.1415$cr1.226561@nnrp2.sbc.net> (raw)
In-Reply-To: wccn1g2cnfb.fsf@world.std.com

"Robert A Duff" <bobduff@world.std.com> wrote in message
news:wccn1g2cnfb.fsf@world.std.com...
> Arnaud de Muyser <ademuyser@attol-testware.com> writes:
>
> > I've a little question about operator "+" resolution into
> > the following pack2-proc.adb procedure.
> > Why the resolved type (by gnat) is standard.integer whereas
> > the visible type named Integer is pack.integer (using use clause).
>
> Names from outer scopes always take precedence over use-visible
names.
> Everything is nested within Standard.  So in your example,
> Standard.Integer hides Pack.Integer.
>
> I don't like that rule -- it's error prone, as you can see.
> Hiding considered harmful.

But there is a benefit to the rule that use-visible names don't hide
names that are already visible -- a use clause added later won't
change the meaning of an existing bit of code.  Granted it can be
confusing with the names declared within Standard, but overall it
seems worth the price, especially given that declaring names identical
to those in Standard seems confusing anyway.

---
Patrick Rogers                      Consulting and Training in:
http://www.classwide.com      Deadline Schedulability Analysis
progers@classwide.com        Software Fault Tolerance
(281)648-3165                       Real-Time/OO Languages

Adam ... does not deserve all the credit; much is due to Eve, the
first woman, and Satan, the first consultant.
Mark Twain








  parent reply	other threads:[~2000-10-18  0:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-10-18  0:00 Redefining Integer Type Arnaud de Muyser
2000-10-18  0:00 ` Robert A Duff
2000-10-18  0:00   ` Gautier
2000-10-18  0:00   ` Pat Rogers [this message]
2000-10-18  0:00     ` Robert A Duff
replies disabled

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