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!news2.google.com!news.glorb.com!feeder.erje.net!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!gegeweb.org!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 06:34: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:9016 Date: 2010-02-09T06:34:59+00:00 List-Id: >>> In Ada, if you do "P(X(5..10));" procedure P can see that the >>> lower bound is 5. That's a break in the abstraction -- P shouldn't >>> know or care where the string came from. >> For many, but not all, P. > >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;