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.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,da5197b9dca0ed40 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,UTF8 Path: g2news1.google.com!news1.google.com!npeer03.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!nx02.iad01.newshosting.com!newshosting.com!198.186.194.249.MISMATCH!transit3.readnews.com!news-out.readnews.com!postnews3.readnews.com!not-for-mail Message-Id: <4c14e3fd$0$2382$4d3efbfe@news.sover.net> From: "Peter C. Chapin" Subject: Re: Processing array subsections, a newbie question. Newsgroups: comp.lang.ada Date: Sun, 13 Jun 2010 10:01:20 -0400 References: <4c13db30$0$2391$4d3efbfe@news.sover.net> <8739wsottd.fsf@ludovic-brenta.org> <9e1f3f35-6f49-468f-be89-46d4f51f8193@f17g2000vbl.googlegroups.com> User-Agent: KNode/0.10.9 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8Bit Organization: SoVerNet (sover.net) NNTP-Posting-Host: fea0d031.news.sover.net X-Trace: DXC=i7U5lETSKS]]\gY6A9AfkVK6_LM2JZB_SJ5R`gYClY@^:WUUlR<856_QW@5e05N>Q[TEQO2OAnh8Z X-Complaints-To: abuse@sover.net Xref: g2news1.google.com comp.lang.ada:11676 Date: 2010-06-13T10:01:20-04:00 List-Id: Gene wrote: > Yes! Or save a line with > > loop >    Do_Something(Buffer, Index_Fst, Index_Lst, Ok); >    exit when not Ok or Index_Fst = Buffer'Last; >    Index_Fst := Index_Lst + 1; > end loop; > > Loop exit (with optional naming, which obviates the problems of > 'break' in C and its successors) is one of the small beauties of Ada... Thanks for the suggestion (by you and others) for using a loop exit. SPARK has some restrictions on how 'exit' can be used; I'm not sure if they will apply to my case or not, but I can look into it. In my case there is also a state machine involved and the exiting would have to take place inside a case statement inside the loop. I seem to recall that SPARK has an issue with exiting from nested control structures but I can experiment. Peter