From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,1c4a54744b1a13e2 X-Google-Attributes: gid103376,public From: "Pat Rogers" Subject: Re: Redefining Integer Type ... Date: 2000/10/18 Message-ID: <9viH5.1415$cr1.226561@nnrp2.sbc.net>#1/1 X-Deja-AN: 682899927 References: <39ED8FE6.3F7CF3B9@attol-testware.com> X-Priority: 3 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.3018.1300 X-Complaints-To: abuse@swbell.net X-Trace: nnrp2.sbc.net 971879493 208.191.184.67 (Wed, 18 Oct 2000 09:31:33 CDT) Organization: SBC Internet Services X-MSMail-Priority: Normal NNTP-Posting-Date: Wed, 18 Oct 2000 09:31:33 CDT Newsgroups: comp.lang.ada Date: 2000-10-18T00:00:00+00:00 List-Id: "Robert A Duff" wrote in message news:wccn1g2cnfb.fsf@world.std.com... > Arnaud de Muyser 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