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!news.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: "Jeffrey R. Carter" Newsgroups: comp.lang.ada Subject: Re: Building an encapsulated library that uses GNAT sockets under Windows Date: Wed, 27 Apr 2016 16:43:06 -0700 Organization: Also freenews.netfront.net; news.tornevall.net; news.eternal-september.org Message-ID: References: <58a4942a-452a-4f32-b39b-f8f1fdbfe9fb@googlegroups.com> <68353b5d-94dc-4604-bdb1-00b48396ec1b@googlegroups.com> <33e880a1-df5f-450c-89e0-9b1d1a95e12f@googlegroups.com> <6c3cb21b-f729-4599-afb0-793c8b8fc2b8@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Wed, 27 Apr 2016 23:39:45 -0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="48b46be33beed75863f69afa437f956b"; logging-data="20708"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18f4okrpKPNVFWf/yXqtmEl5wsXjtMkIKg=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.0 In-Reply-To: Cancel-Lock: sha1:5sEpn8t9hiM8w3Ui3Q3n9PoK7pM= Xref: news.eternal-september.org comp.lang.ada:30307 Date: 2016-04-27T16:43:06-07:00 List-Id: On 04/27/2016 03:16 PM, Randy Brukardt wrote: > > loop > {some code} > if something then > goto Continue; > end if; > {more code} > <> -- Ada 95 requires "null;" here, Ada 2012 does not. > end loop; > > To completely eliminate the goto, one has to use a Boolean variable instead, > or duplicate parts of the loop; both of those obscure what is going on more > than the goto. This claim is completely untrue. The example loop is equivalent to loop {some code} if not something then {more code} end if; end loop; No Boolean variable (not already present), no duplication of parts of the loop, and less obscuration that the goto, which could go almost anywhere, while the if must terminate within the loop. It's easier to find the end of the if than it is to find the target of the goto. A conditional continue statement is always equivalent to such an if. -- Jeff Carter "We'll make Rock Ridge think it's a chicken that got caught in a tractor's nuts!" Blazing Saddles 87