comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: Substrings as argument to procedures/functions
Date: Mon, 25 Apr 2016 17:07:02 -0500
Date: 2016-04-25T17:07:02-05:00	[thread overview]
Message-ID: <nfm4e7$jqr$1@loke.gir.dk> (raw)
In-Reply-To: 518c7059-14c6-4344-a251-129cca2621af@googlegroups.com

<rieachus@comcast.net> wrote in message 
news:518c7059-14c6-4344-a251-129cca2621af@googlegroups.com...
On Wednesday, April 13, 2016 at 5:29:29 PM UTC-4, Randy Brukardt wrote:

>> Probably a better example is to remember that the range of Positive is
>> implementation-defined, and that the language only requires the upper 
>> bound
>> to be at least 32767. So if you need strings that have potentially more
>> characters than that (to read an entire text file, for instance), and you
>> want the code to be unconditionally portable (to steal someone else's 
>> line),
>> you need to declare a type yourself (here, assuming that a million
>> characters are enough)...
>
>Is it time to "fix" this?

Use of predefined types is evil, so who cares?

>Or are there still Ada compilers around that use 16-bit String indexes by 
>default?

Janus/Ada for one.

All versions of Janus/Ada have had Integer as 16-bit. Changing that would 
destroy compatability of binary files (Sequential_IO, Direct_IO, Stream_IO) 
and of course would have other effects as well.

I've considered having some sort of optional way to change the definition of 
Integer (it's defined in a single place), but the problem is that 
*everything* depends upon that, so one would end up with two different 
incompatible compilers/runtimes. The maintenance headaches would be immense 
(any mix-up would cause bizarre internal errors).

Good code doesn't depend on predefined types in the first place, so it's 
mainly a problem dealing with the predefined packages. (And that's mainly a 
problem with the predefined packages depending on type String.)

                           Randy.


  reply	other threads:[~2016-04-25 22:07 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
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 [this message]
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