comp.lang.ada
 help / color / mirror / Atom feed
From: Mart van de Wege <mvdwege@gmail.com>
Subject: Re: Substrings as argument to procedures/functions
Date: Wed, 13 Apr 2016 14:30:34 +0200
Date: 2016-04-13T14:30:34+02:00	[thread overview]
Message-ID: <861t69r8r9.fsf@gaheris.avalon.lan> (raw)
In-Reply-To: 1460548465.940.5.camel@obry.net

Pascal Obry <pascal@obry.net> 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.

  reply	other threads:[~2016-04-13 12:30 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-12  8:25 Substrings as argument to procedures/functions reinkor
2016-04-12  9:01 ` Dmitry A. Kazakov
2016-04-12 16:55   ` reinkor
2016-04-12 18:37     ` Dmitry A. Kazakov
2016-04-13  4:44       ` reinkor
2016-04-13  7:19         ` Dmitry A. Kazakov
2016-04-13 10:16         ` Brian Drummond
2016-04-13 11:43           ` reinkor
2016-04-13 11:54             ` Pascal Obry
2016-04-13 12:30               ` Mart van de Wege [this message]
2016-04-13 12:47                 ` Egil H H
2016-04-13 13:19                   ` Mart van de Wege
2016-04-13 16:57                 ` Jeffrey R. Carter
2016-04-12 18:17 ` Robert A Duff
2016-04-12 18:34 ` Jeffrey R. Carter
2016-04-13 21:29   ` Randy Brukardt
2016-04-25 15:33     ` rieachus
2016-04-25 22:07       ` Randy Brukardt
2016-04-26  6:12         ` Georg Bauhaus
2016-04-26 18:41           ` Randy Brukardt
2016-04-13 11:22 ` G.B.
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox