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=ham 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,ASCII-7-bit Path: g2news2.google.com!news1.google.com!npeer03.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!post02.iad.highwinds-media.com!news.flashnewsgroups.com-b7.4zTQh5tI3A!not-for-mail From: Stephen Leake Newsgroups: comp.lang.ada Subject: Re: Processing array subsections, a newbie question. References: <4c13db30$0$2391$4d3efbfe@news.sover.net> <82631nmc3v.fsf@stephe-leake.org> Date: Sun, 13 Jun 2010 21:45:09 -0400 Message-ID: <82wru2jska.fsf@stephe-leake.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (windows-nt) Cancel-Lock: sha1:vy0C2oRGZRrEo9yYXJhqcZt73QY= MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Complaints-To: abuse@flashnewsgroups.com Organization: FlashNewsgroups.com X-Trace: 1e2a94c1589bfe197caa718161 Xref: g2news2.google.com comp.lang.ada:12662 Date: 2010-06-13T21:45:09-04:00 List-Id: Simon Wright writes: > Stephen Leake writes: > >> "Peter C. Chapin" writes: >> >>> procedure Do_Something >>> (Buffer : in Buffer_Type; >>> Fst : in Natural; >>> Lst : out Natural; >>> Ok : out Boolean); >> >> Change this to: >> >> procedure Do_Something >> (Buffer : in Buffer_Type; >> Last : in out Natural; >> Ok : out Boolean); >> >> -- Operate on Buffer (Last + 1 ..), update Last to last item operated >> -- on. > > What would happen if Buffer'First was Natural'First? Good point. Last should be Integer, not Natural, so Last can be initialized to Buffer'first - 1. Which involves defining the type with an "extra" value, which Peter said he didn't like. I find it quite useful in situations like this. -- -- Stephe