comp.lang.ada
 help / color / mirror / Atom feed
From: Robert Eachus <rieachus@comcast.net>
Subject: Re: Tests in a software release
Date: Wed, 22 Nov 2017 12:40:08 -0800 (PST)
Date: 2017-11-22T12:40:08-08:00	[thread overview]
Message-ID: <ed46ecdf-9eb3-4ae6-8064-2fa475431d8a@googlegroups.com> (raw)
In-Reply-To: <oula05$oej$1@franka.jacob-sparre.dk>

On Thursday, November 16, 2017 at 7:20:22 PM UTC-5, Randy Brukardt wrote:

> The main reason to use a goto in Ada 2012 is for the (missing) loop 
> continue statement. I do this quite often (and so does the GNAT code,
> if I'm remembering correctly) -- real code being much more complex
> than this:

>     loop 
>         ... 
>        if ... 
>            ... 
>            goto Continue; -- Start next iteration. 
>        end if; 
>         ... 
>         <<Continue>> 
>     end loop; 

Shrug. Even if the loop is intended to run until the power shuts off--an example is the flight control software for an airplane--that construct clearly implements a finite state machine, and I'd probably include the FSM in the documentation.  I'd definitely include the FSM if there is another way out of that loop other than power failing usually one or more return statements. One or more exceptions can do the same thing, and it helps to document how you can get to the exception handler from the loop.

And by 'it helps' I don't mean only during maintenance.  I've spent days working back and forth from the documentation to the source code until they agreed, and agreed with the requirements.

More simply said, most FSMs in Ada are implemented as loops without for or while clauses.  The alternative has a label at the entrance and several gotos
back to it.

  reply	other threads:[~2017-11-22 20:40 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-25 19:30 Tests in a software release Victor Porton
2017-10-26  7:20 ` Dmitry A. Kazakov
2017-10-27 18:06   ` G. B.
2017-10-27 18:54     ` Dmitry A. Kazakov
2017-10-28  6:53       ` G.B.
2017-10-28  7:35         ` Dmitry A. Kazakov
2017-10-30 20:44           ` G. B.
2017-10-30 20:56             ` Dmitry A. Kazakov
2017-10-31  7:17               ` G.B.
2017-10-31  8:32                 ` Dmitry A. Kazakov
2017-11-03  7:24                   ` G.B.
2017-11-03  8:16                     ` Dmitry A. Kazakov
2017-11-03 12:49                     ` Shark8
2017-11-04 10:15                       ` G.B.
2017-11-15  0:11                     ` Randy Brukardt
2017-11-15 17:57                       ` G. B.
2017-11-15 20:46                         ` Dmitry A. Kazakov
2017-11-17 15:36                           ` Shark8
2017-11-15 22:17                         ` Randy Brukardt
2017-11-16 21:44                           ` G.B.
2017-11-17  0:15                             ` Randy Brukardt
2017-11-17 15:45                             ` Shark8
2017-11-18  1:07                               ` Randy Brukardt
2017-11-15  0:06                   ` Randy Brukardt
2017-11-15  8:47                     ` Dmitry A. Kazakov
2017-11-15 21:53                       ` Randy Brukardt
2017-11-15 16:47                     ` Jeffrey R. Carter
2017-11-15 16:59                       ` J-P. Rosen
2017-11-15 20:45                         ` Dmitry A. Kazakov
2017-11-15 21:58                         ` Randy Brukardt
2017-11-16  5:50                           ` J-P. Rosen
2017-11-16 23:53                             ` Randy Brukardt
2017-11-15  0:01                 ` Randy Brukardt
2017-11-16 17:02           ` Robert Eachus
2017-11-17  0:20             ` Randy Brukardt
2017-11-22 20:40               ` Robert Eachus [this message]
2017-11-14 23:55       ` Randy Brukardt
2017-10-26  8:09 ` Stefan.Lucks
2017-10-26 17:30 ` Simon Clubley
replies disabled

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