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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,5c1c45943bf6a5bc X-Google-Attributes: gid103376,public From: bobduff@world.std.com (Robert A Duff) Subject: Re: 'first of strings returned from a function should be 1? Date: 1997/07/30 Message-ID: #1/1 X-Deja-AN: 260599960 References: <199707291314.PAA24611@basement.replay.com> Organization: The World Public Access UNIX, Brookline, MA Newsgroups: comp.lang.ada Date: 1997-07-30T00:00:00+00:00 List-Id: In article <199707291314.PAA24611@basement.replay.com>, Anonymous wrote: >procedure P (S : in out String); >.. >V : String (1 .. 100); >.. >P (V (5 .. 96) ); > >What happens inside P? Does this part of V have a lower bound of 1 >inside P but a lower bound of 5 outside? Not sure what you mean by inside and outside. There's a single slice, and the Ada rule is that its lower bound is 5, whereas I claim a better rule would be that the lower bound of all strings, including this slice, be 1. Inside P, saying "S(1) := 'x';" would modify V(5), given this not-Ada rule. The point is that P shouldn't have to know it's being passed a slice of something else -- it just has a sequence of characters, which it can modify. - Bob