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: a07f3367d7,bf03d731a6ef511f X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!proxad.net!feeder1-2.proxad.net!news.in2p3.fr!in2p3.fr!news.ecp.fr!aioe.org!not-for-mail From: tmoran@acm.org Newsgroups: comp.lang.ada Subject: Re: Copying rows in a two dimensional array. Date: Tue, 9 Feb 2010 18:49:59 +0000 (UTC) Organization: Aioe.org NNTP Server Message-ID: References: NNTP-Posting-Host: J4HSNf9Eqj44wTz1J3b8lQ.user.speranza.aioe.org X-Complaints-To: abuse@aioe.org X-Notice: Filtered by postfilter v. 0.8.2 X-Newsreader: Tom's custom newsreader Xref: g2news1.google.com comp.lang.ada:9045 Date: 2010-02-09T18:49:59+00:00 List-Id: >> Integer_IO.Get(Line(Last+1 .. Line'last), V(i), Last); >... >I'd still prefer all strings start at 1, and I'd do parsing of >a text stream of integers in a different way (keep track >of current position without using slices at all). I wouldn't usually parse a text stream of integers like that either, but it's a very short example, using a routine in the standard library. In general, the index of a found item in an array search is more helpful than the offset. For instance, function Find_Biggest(X : in Array_Type) return Index_Type; leads to a cleaner recursive (or multitasking) divide-and-conquer routine than returning an offset into the array. The offset is a means to the end, while the index is the end itself, and you can't return the index if you don't know the X'first.