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!feeder.eternal-september.org!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Community Input for the Maintenance and Revision of the Ada Programming Language Date: Tue, 3 Oct 2017 12:11:03 +0200 Organization: Aioe.org NNTP Server Message-ID: References: <915874b5-52c0-4aa8-9023-82fddedb816f@googlegroups.com> <67345f73-530c-400b-9eb4-63eeb440154c@googlegroups.com> <9a6338d9-83be-4e45-b8b7-edc56e33537f@googlegroups.com> <2deb28e2-f7e8-4461-b8b8-c2c6cf2784aa@googlegroups.com> <5de470d2-aa3d-4c02-ae2b-266c33a289fe@googlegroups.com> NNTP-Posting-Host: MajGvm9MbNtGBKE7r8NgYA.user.gioia.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 X-Notice: Filtered by postfilter v. 0.8.2 Content-Language: en-US Xref: news.eternal-september.org comp.lang.ada:48311 Date: 2017-10-03T12:11:03+02:00 List-Id: On 2017-10-03 11:34, G.B. wrote: > (But, still, predefined string types from the Ada library > depend on types Positive and Natural with their implementation > defined ranges. I understand that the 'Size of these types > is 16 in Janus/Ada?) I don't see this as a big problem so long you physically could not create larger String objects, e.g. because of the memory architecture. It is not much different from Stream_Element_Array using Stream_Element_Offset. Some time ago GNAT changed Stream_Element_Offset from 32 to 64 bits on 32-bit machines. Same can be done for Integer. Anyway it brings back the argument of bounded-length strings design. The size of Integer is not an issue for String because it acts as a *constraint*, not as a type property. This does not make any program illegal. So long you don't *actually* try to exceed the constraint, nothing bad happens. It is not very likely you would actually use strings larger than 32K. Now if size/bound becomes a type or object property that makes some programs illegal. Arguably that could be desirable if the bound comes from the problem space. However in most cases it is just more or less arbitrary design choice which will hit you hard later if you were too generous. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de