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!news1.google.com!npeer01.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!nx01.iad01.newshosting.com!209.197.12.246.MISMATCH!nx02.iad01.newshosting.com!newshosting.com!198.186.194.249.MISMATCH!news-out.readnews.com!transit3.readnews.com!panix!bloom-beacon.mit.edu!newsswitch.lcs.mit.edu!nntp.TheWorld.com!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: Copying rows in a two dimensional array. Date: Tue, 09 Feb 2010 09:29:02 -0500 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: pcls6.std.com 1265725729 24817 192.74.137.71 (9 Feb 2010 14:28:49 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Tue, 9 Feb 2010 14:28:49 +0000 (UTC) User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.3 (irix) Cancel-Lock: sha1:/4SI9UP4sHAxHGvLDS+2ambhNqo= Xref: g2news1.google.com comp.lang.ada:9033 Date: 2010-02-09T09:29:02-05:00 List-Id: tmoran@acm.org writes: >>Can you give an example where P should know that its String >>parameter came from a slice, and should know the lower bound >>of that slice? I can't think of any off the top of my head >>-- it just seems like a fundamentally broken abstraction if >>you care about the lower bound of a string. > > package Int_IO is new Ada.Text_IO.Integer_IO(Integer); > ... > Last := Line'first-1; > for i in V'range loop > Integer_IO.Get(Line(Last+1 .. Line'last), V(i), Last); > end loop; Interesting example. Thanks! 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). - Bob