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=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!feeder.eternal-september.org!newsfeed.kamp.net!newsfeed.kamp.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Mart van de Wege Newsgroups: comp.lang.ada Subject: Re: Substrings as argument to procedures/functions Date: Wed, 13 Apr 2016 14:30:34 +0200 Message-ID: <861t69r8r9.fsf@gaheris.avalon.lan> References: <2055a188-fb5f-496a-ab37-b25d81cebe1b@googlegroups.com> <5271bc70-bfea-4e2f-b4e3-6c847843f5b4@googlegroups.com> <9c28eac4-8edf-45dc-afcd-082abfd4cf4b@googlegroups.com> <1460548465.940.5.camel@obry.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: individual.net Dv8UQ+soRoUs/0TOGcwATQUsy4JlCzbNe199aYhH45Ll1qVLbr X-Orig-Path: gaheris.avalon.lan!not-for-mail Cancel-Lock: sha1:W9b/NoWlk/xWbWb9wnqubb2XZ+4= sha1:dZZMn85GKdudFP5swMS16SlcByI= User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) Xref: news.eternal-september.org comp.lang.ada:30095 Date: 2016-04-13T14:30:34+02:00 List-Id: Pascal Obry writes: > Le mercredi 13 avril 2016 à 04:43 -0700, reinkor a écrit : >> If a complex subroutine is made by a subcontract (in the country far >> far away), >> then it is in general a point to provide only the necessary >> information >> to make the subroutine? I mean, if paranoia is in charge ? :-) > > No the point is for programmers to stop assuming anything about the > data passed as argument. And here Ada shine, it gives you 'First, > 'Last, 'Range... I do have a minor question here though: That does not work if you have any reason to try and modify the first character of a String. S(1) := To_Upper(S(1)) works, but S'First := To_Upper(S'First) does not. So how do I handle that particular case? (In my case I just threw in a localised 'Pragma Warnings' to turn off the GNAT warning, but that's a workaround, not a solution, IMO). Mmart -- "We will need a longer wall when the revolution comes." --- AJS, quoting an uncertain source.