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=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,81bb2ce65a3240c3 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.204.153.209 with SMTP id l17mr833562bkw.4.1335452541616; Thu, 26 Apr 2012 08:02:21 -0700 (PDT) Path: h15ni168132bkw.0!nntp.google.com!news1.google.com!news3.google.com!proxad.net!feeder1-2.proxad.net!usenet-fr.net!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Mart van de Wege Newsgroups: comp.lang.ada Subject: Re: What would you like in Ada202X? Date: Thu, 26 Apr 2012 16:57:16 +0200 Message-ID: <86397qv8vn.fsf@gaheris.avalon.lan> References: <3637793.35.1335340026327.JavaMail.geo-discussion-forums@ynfi5> <31103380.3735.1335377235157.JavaMail.geo-discussion-forums@vbuo17> <26317529.742.1335381313996.JavaMail.geo-discussion-forums@ynje10> <17572718.3572.1335384748259.JavaMail.geo-discussion-forums@vbbfk16> <30695328.1199.1335386401806.JavaMail.geo-discussion-forums@yndm3> <86r4vb0whn.fsf@gaheris.avalon.lan> <4f990b73$0$16283$9b4e6d93@newsspool1.arcor-online.net> Mime-Version: 1.0 X-Trace: individual.net PxPXk0uetqq1D1jnj/LpKg/w+Tkgfi1NvqJv7UUwjmCscvxL11 X-Orig-Path: gaheris.avalon.lan!not-for-mail Cancel-Lock: sha1:F+Oy+u1gtyjCXlZZ/Jhj/8GmTg8= sha1:OtcoQSYM7RWyNCC6BQvXCRypXSA= User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.4 (gnu/linux) Content-Type: text/plain; charset=us-ascii Date: 2012-04-26T16:57:16+02:00 List-Id: Georg Bauhaus writes: >> >> Although it *is* considered good practice to put your 'next' statements >> at the top of the loop to make clear on what conditions the main body >> will be skipped. > > Actually, "next" in Perl doesn't jump to the top of the loop. I didn't actually say that. Read carefully. 'next' will immediately skip to the next iteration of a loop. Processing of the loop body stops at next; therefore it is considered good practice to put your 'next' statements at the top of the loop, so that it is immediately clear under which conditions the loop body is skipped. > >> 'next' statements littered throughout the body of the >> loop are frowned upon. > > Yet, multiple uses of "last"(?) were recommended to emulate > a switch statement prior to Perl 5.something... Oh, I'm not saying Perl is without warts. But I still like it a lot, even if I'm really warming up to Ada as well (and isn't that a weird pair of favourite programming languages?). But as for the missing switch, using 'last' was one way to build one, alternating elsif blocks another, and my particular favourite was to use a dispatch table using a hash of sub references. Mart -- "We will need a longer wall when the revolution comes." --- AJS, quoting an uncertain source.