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!.POSTED!not-for-mail From: "Jeffrey R. Carter" Newsgroups: comp.lang.ada Subject: Re: stopping a loop iteration without exiting it Date: Fri, 5 Jan 2018 16:21:31 +0100 Organization: Also freenews.netfront.net; news.tornevall.net; news.eternal-september.org Message-ID: References: <81971548-23c9-4927-a6a8-6f0f1dba896b@googlegroups.com> <867esx70lw.fsf@gaheris.avalon.lan> <86373k74qh.fsf@gaheris.avalon.lan> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Fri, 5 Jan 2018 15:21:31 -0000 (UTC) Injection-Info: reader02.eternal-september.org; posting-host="f5d98908cdce36eccd1e824541905cc9"; logging-data="11440"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+qsLsKo3NFbA+20aCU5QT7VP64uS5QSB4=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 In-Reply-To: <86373k74qh.fsf@gaheris.avalon.lan> Content-Language: en-US Cancel-Lock: sha1:FOYp8FqGSM2nmVYlXuhtmC37NT8= Xref: reader02.eternal-september.org comp.lang.ada:49768 Date: 2018-01-05T16:21:31+01:00 List-Id: On 01/05/2018 03:35 PM, Mart van de Wege wrote: > > The idiom is in common use, even if it is not in a language to your > liking, so your 'never seen a real-world situation' remark is simply not > true. I never said I've never seen a real-world situation in which such a construct is used. I said I've never seen one where it was needed. That is still true. > Creating an unnecessary extra block, making code less readable. And what > of the situation where you want to test for more than one exceptional > situation before handing over your input to the main body of the loop? > You want nested ifs? Code such that a single "if" will significantly impact the readability needs to be rethought anyway. If there are multiple tests, I am familiar with the "and" operator. If they need to be executed in a specific order, I am familiar with "and then". Nested ifs are unnecessary; I have no idea why you would think they would be. -- Jeff Carter "Brave Sir Robin ran away." Monty Python and the Holy Grail 59