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-Language: ENGLISH,ASCII X-Google-Thread: 103376,789b3fa522bdcc2a X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-04-04 02:50:03 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!newsfeed.vmunix.org!uio.no!newsfeed.kolumbus.fi!newsfeed1.fi.sn.net!fi.sn.net!newsfeed2.fi.sn.net!newsfeed1.bredband.com!bredband!newsfeed1.telenordia.se!algonet!uab.ericsson.se!erinews.ericsson.se!news.ericsson.se!not-for-mail From: Frode Tenneboe Newsgroups: comp.lang.ada Subject: Re: Optimising string handling in application Date: Fri, 4 Apr 2003 10:44:50 +0000 (UTC) Organization: Ericsson AS Message-ID: <1049453076.981330@edh3> References: <1049267738.39983@edh3> <5uGia.304058$L1.86794@sccrnsc02> NNTP-Posting-Host: edh3.edh.ericsson.se Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: newstree.wise.edt.ericsson.se 1049453090 23368 193.180.212.12 (4 Apr 2003 10:44:50 GMT) X-Complaints-To: abuse@ericsson.se NNTP-Posting-Date: Fri, 4 Apr 2003 10:44:50 +0000 (UTC) User-Agent: tin/1.4.1-19991201 ("Polish") (UNIX) (SunOS/5.8 (sun4u)) Cache-Post-Path: edh3!unknown@alne X-Cache: nntpcache 2.3.3 (see http://www.nntpcache.org/) Xref: archiver1.google.com comp.lang.ada:35920 Date: 2003-04-04T10:44:50+00:00 List-Id: tmoran@acm.org wrote: >> Follow-up question: Is it safe to asume that strings _allways_ >> start with 'First = 1 (provided the (sub)type starts with 1) except when >> passing slices where 'First = start_of_slice? > Luckily, you needn't assume anything. There are specific rules about > the value of 'first. If those rules, in some particular case, don't > *guarantee* that 'first=1, then you can't "assume" that 'first=1. Bad phrasing of the question. I looked in RM 4.3.3 (Array aggregates) for an answer, but I'm still not absolutely certain that my perception of strings (or other array-types for that matter) is correct. For subprograms which can accept unconstrained arrys (eg. String) it is necessary to use 'First and friends. Is this the only case where it is not guaranteed that 'First = 1? Example: procedure Replace_Callsign_In_Msg (Msg : in out Dpu_Loc_Messages.T_Msg_Data_Str; Msg_Length : in out T_Integer_32; Callsign : in Dpu_Loc_Messages.T_Msg_Callsign; Callsign_Length : in Positive) is If I were to call this with: Replace_Callsign_In_Msg (Msg => Loc_Insert_Msg.Data(2..Loc_Insert_Msg.Data'Last), Msg_Length => Loc_Insert_Msg.Data_Length-1, Callsign => Individual_Callsigns.Callsigns(I).Callsign, Callsign_Length => Individual_Callsigns.Callsigns(I).Length); Can I assume that 'First of Msg inside Replace_Callsign_In_Msg =1? Where in RM is this dealt with? Regards, -Frode -- ^ Frode Tenneb� | email: Frode.Tennebo@eto.ericsson.se ^ | Ericsson AS., N-1788 Halden | Phone: +47 67 25 09 39 | | with Standard.Disclaimer; use Standard.Disclaimer; |