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=0.4 required=5.0 tests=BAYES_00,FORGED_MUA_MOZILLA autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,45c6e2680274292d X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII Received: by 10.66.86.168 with SMTP id q8mr43275paz.30.1342750005379; Thu, 19 Jul 2012 19:06:45 -0700 (PDT) Path: b9ni8412831pbl.0!nntp.google.com!npeer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!border3.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!border4.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!novia!news-peer1!btnet!zen.net.uk!hamilton.zen.co.uk!xlned.com!feeder5.xlned.com!ramfeed-1.ams.xsnews.nl!feed.xsnews.nl!border-1.ams.xsnews.nl!plix.pl!newsfeed2.plix.pl!news.mi.ras.ru!goblin2!goblin.stu.neva.ru!news.internetdienste.de!news.tu-darmstadt.de!fu-berlin.de!dotsrc.org!filter.dotsrc.org!news.dotsrc.org!not-for-mail Date: Mon, 16 Jul 2012 14:29:43 +0200 From: =?ISO-8859-1?Q?Thomas_L=F8cke?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:13.0) Gecko/20120710 Thunderbird/13.0.1 MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Labeled exit within generalized labeled loop not allowed? References: <5003dffc$0$291$14726298@news.sunsite.dk> In-Reply-To: Message-ID: <50040937$0$288$14726298@news.sunsite.dk> Organization: SunSITE.dk - Supporting Open source NNTP-Posting-Host: 77.234.168.90 X-Trace: news.sunsite.dk DXC=[lT==a]6W4jMMDg2]64EMfYSB=nbEKnkk7g5VgL7EZ4d3ZOKe3?:>XacAE?;m5ccYc3>^Oo7SFd^Hj X-Complaints-To: staff@sunsite.dk X-Received-Bytes: 3129 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Date: 2012-07-16T14:29:43+02:00 List-Id: On 07/16/2012 02:03 PM, Niklas Holsti wrote: > I forgot to state my conclusion explicitly (at the end, below): >> To me, the generalized loop syntax suggests that the loop should be >> executed for all the elements in the container, that the amount of data >> in the container does not change during the loop, and that the traversal >> order is not important. I know that the order is defined; I am talking >> about my impression while reading the program. I'm not sure if data can >> be added to or removed from a container during a generalized iteration >> over the container; would that be "tampering"? > > The conclusion is that I (as one example of an Ada programmer) usually > would not code an exit statement (whether labeled or unlabeled) in a > simple loop that uses the generalized loop syntax, because then the loop > would not process all the elements in the container. > > Vice versa, I would also be unlikely to use the generalized loop syntax > for a loop that needs a labeled exit statement, because such a loop is > likely to be more complex and dynamic than seems suitable (to me) for > the generalized loop syntax. Moreover, an exit statement usually means > that iteration order is important, which I (subjectively) do not > associate with the generalized syntax. To me, the new generalized loops are mostly syntactic sugar. I don't associate them with loops where the loop _must_ be executed for all elements. I think you're right: It's probably an undiscovered compiler bug due to low usage of the feature. But low usage does not equal no usage. I want my named exit statements back! :D -- Thomas L�cke | thomas@12boo.net | http://12boo.net