comp.lang.ada
 help / color / mirror / Atom feed
From: Niklas Holsti <niklas.holsti@tidorum.invalid>
Subject: Re: Some questions about GPS
Date: Mon, 23 Jul 2018 22:09:50 +0300
Date: 2018-07-23T22:09:50+03:00	[thread overview]
Message-ID: <frmnfuF4ukcU1@mid.individual.net> (raw)
In-Reply-To: <9f8bc09e-14a6-47a4-8083-caa1857ec6e9@googlegroups.com>

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
       .      @       .


  parent reply	other threads:[~2018-07-23 19:09 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-23 18:26 Some questions about GPS Ian Douglas
2018-07-23 19:01 ` Jacob Sparre Andersen
2018-07-23 20:17   ` Ian Douglas
2018-07-23 19:02 ` Dmitry A. Kazakov
2018-07-23 19:09 ` Niklas Holsti [this message]
2018-07-23 21:10 ` Jeffrey R. Carter
2018-07-24 20:01 ` Ian Douglas
2018-07-26 13:33   ` Patrick Noffke
2018-07-27 10:03     ` Ian Douglas
replies disabled

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