From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.5-pre1 (2020-06-20) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-0.9 required=3.0 tests=BAYES_00,FROM_ADDR_WS autolearn=no autolearn_force=no version=3.4.5-pre1 Date: 8 Nov 91 20:53:35 GMT From: csn!news.den.mmc.com!possum.den.mmc.com!dow@boulder.colorado.edu (Mark D ow) Subject: Re: Is this valid Ada? Message-ID: <1991Nov8.205335.23255@den.mmc.com> List-Id: In article <37806@shamash.cdc.com> case@shamash.cdc.com (Steven V. Case) writes : >The following code fragment compiles on two of the Ada compilers that I am >presently using. However, on two other compilers that I am using it won't >compile. The later two compilers provide an error message indicating that >the call to Is_This_Ambiguous is an ambiguous statement and references >paragraph 8.7 of the LRM. > >I have read paragraph 8.7 several times and cannot find anything that leads >me to believe that this code fragment is not legal. Consequently, I don't >know which pair of compilers has a bug. If the code is legal, then the >compilers issuing the error message have a bug. If the code is illegal, >then the compilers not issuing the error message have a bug. > >Anyone care to offer an opinion? > I am convinced that this is legal Ada and that the compilers that flagged it as an error are wrong. This opinion is based not so much on the information in paragraph 8.7, or 8.3 (another logical place to look) but instead on the information in paragraph 8.4. Paragraph 8.4 (5) states: "A potentially visible declaration is not made directly visible if the place considered is within the immediate scope of a homograph of the declaration." The LRM continues with 8.4 (8): "The above rules guarantee that a declaration that is made directly visible by a use clause cannot hide an otherwise directly visible declaration." By the way, a co-worker of mine who has a particular affinity for C is flabbergasted by a language where the legality of so few lines of code is in question. Of course, I am sure that it would not take any of us very long to write a few lines of C that may be somewhat confusing. ;-) -- Mark Dow dow@pogo.den.mmc.com