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,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.107.166.69 with SMTP id p66mr3741785ioe.85.1511383208628; Wed, 22 Nov 2017 12:40:08 -0800 (PST) X-Received: by 10.157.11.207 with SMTP id 73mr937103oth.2.1511383208557; Wed, 22 Nov 2017 12:40:08 -0800 (PST) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!border1.nntp.ams1.giganews.com!nntp.giganews.com!peer01.ams1!peer.ams1.xlned.com!news.xlned.com!peer01.am4!peer.am4.highwinds-media.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!d140no3895882itd.0!news-out.google.com!193ni7121iti.0!nntp.google.com!i6no3898897itb.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Wed, 22 Nov 2017 12:40:08 -0800 (PST) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=2601:191:8303:2100:1874:7b05:762e:e9fa; posting-account=fdRd8woAAADTIlxCu9FgvDrUK4wPzvy3 NNTP-Posting-Host: 2601:191:8303:2100:1874:7b05:762e:e9fa References: <920c1eff-2cfa-48d4-a0a7-6b6f0a205ce5@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: Tests in a software release From: Robert Eachus Injection-Date: Wed, 22 Nov 2017 20:40:08 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Received-Body-CRC: 154546881 X-Received-Bytes: 2958 Xref: feeder.eternal-september.org comp.lang.ada:49069 Date: 2017-11-22T12:40:08-08:00 List-Id: 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=20 > 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=20 > ...=20 > if ...=20 > ...=20 > goto Continue; -- Start next iteration.=20 > end if;=20 > ...=20 > <>=20 > end loop;=20 Shrug. Even if the loop is intended to run until the power shuts off--an ex= ample is the flight control software for an airplane--that construct clearl= y implements a finite state machine, and I'd probably include the FSM in th= e documentation. I'd definitely include the FSM if there is another way ou= t of that loop other than power failing usually one or more return statemen= ts. 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 wo= rking back and forth from the documentation to the source code until they a= greed, 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 got= os back to it.