From: Robert A Duff <bobduff@world.std.com>
Subject: Re: Redefining Integer Type ...
Date: 2000/10/18
Date: 2000-10-18T00:00:00+00:00 [thread overview]
Message-ID: <wccn1g2cnfb.fsf@world.std.com> (raw)
In-Reply-To: 39ED8FE6.3F7CF3B9@attol-testware.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.
A good rule of thumb is to never redefine any name (such as Integer)
that is declared in Standard, or *could* be declared in Standard (such
as Long_Long_Long_Long_Long_Integer).
- Bob
next prev 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 [this message]
2000-10-18 0:00 ` Pat Rogers
2000-10-18 0:00 ` Robert A Duff
2000-10-18 0:00 ` Gautier
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox