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=unavailable 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!gandalf.srv.welterde.de!news.jacob-sparre.dk!loke.jacob-sparre.dk!pnx.dk!.POSTED!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Substrings as argument to procedures/functions Date: Mon, 25 Apr 2016 17:07:02 -0500 Organization: JSA Research & Innovation Message-ID: References: <2055a188-fb5f-496a-ab37-b25d81cebe1b@googlegroups.com> <518c7059-14c6-4344-a251-129cca2621af@googlegroups.com> NNTP-Posting-Host: rrsoftware.com X-Trace: loke.gir.dk 1461622023 20315 24.196.82.226 (25 Apr 2016 22:07:03 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Mon, 25 Apr 2016 22:07:03 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 Xref: news.eternal-september.org comp.lang.ada:30284 Date: 2016-04-25T17:07:02-05:00 List-Id: 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.