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.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Niklas Holsti Newsgroups: comp.lang.ada Subject: Re: Some questions about GPS Date: Mon, 23 Jul 2018 22:09:50 +0300 Organization: Tidorum Ltd Message-ID: References: <9f8bc09e-14a6-47a4-8083-caa1857ec6e9@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net 3cnW+R1ZhwLkqji6WkHetwIGC2rORei7Gaa7yRwbU6YMMpJ86Q Cancel-Lock: sha1:b1Elbd+XB1N/5hbj1q7PWsyZ2FA= User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 In-Reply-To: <9f8bc09e-14a6-47a4-8083-caa1857ec6e9@googlegroups.com> Xref: reader02.eternal-september.org comp.lang.ada:53948 Date: 2018-07-23T22:09:50+03:00 List-Id: On 18-07-23 21:26 , Ian Douglas wrote: > Hi > > Please advise if off topic. > > Finally trying to learn Ada, after years of PHP. Did Pascal at > varsity back in the 80s. > > Using GPS on Linux but some things driving me nuts, so need to > determine if "that's the way it is" or is my configuration is flaky. [I'll let someone more knowledgeable about GPS answer Q 1 and 2] > 3. Am trying to read in a file, play with it, and write it out. So > started with "Expanded with proper error handling and reporting it > reads:" example (2nd one) on > https://www.rosettacode.org/wiki/File_input/output#Line_by_line , but > the compiler insists that the two "close input" statements are > "unreachable code". Is this normal? (The quoted text above seems a little garbled, but the URL is whole, so I looked at that.) The two statements that call Close (one for Input, one for Output) and follow the loop, but precede the exception handlers, are indeed unreachable, because the loop can terminate only by raising an exception (normally End_Error), in which case the exception handler is entered. These two Close calls are never executed. This Rosetta-code example should be corrected by removing these statements. > If I comment them out, it > compiles okay. And runs okay. This is as expected. -- Niklas Holsti Tidorum Ltd niklas holsti tidorum fi . @ .