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.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC 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!.POSTED!not-for-mail From: "G.B." Newsgroups: comp.lang.ada Subject: Re: Community Input for the Maintenance and Revision of the Ada Programming Language Date: Tue, 3 Oct 2017 11:34:06 +0200 Organization: A noiseless patient Spider 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> Reply-To: nonlegitur@notmyhomepage.de Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Tue, 3 Oct 2017 09:34:07 -0000 (UTC) Injection-Info: reader02.eternal-september.org; posting-host="f41836b86d45d7c76b77428cfb6b8b4e"; logging-data="22057"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/wYex4DsFyTe5hCGp0GCOBH90jByaKNHc=" User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 In-Reply-To: Content-Language: en-US Cancel-Lock: sha1:jCjleI2N6CcsX3ncV2sUJcoRpXw= Xref: news.eternal-september.org comp.lang.ada:48310 Date: 2017-10-03T11:34:06+02:00 List-Id: On 03.10.17 09:48, Simon Wright wrote: > I have a requirement (based on an interface to an external entity) to > store quite a few names of length no more than 14 characters. It seems > reasonable to implement the storage using Bounded_Strings (unless of > course the GNAT overhead gets too much). GNAT sources say that the compiler "special cases" Bounded_String, referring to its own Ada.Strings.Superbounded. In this package, the type Super_String is a discriminated record, and then type Bounded_String is new Superbounded.Super_String (Max_Length); where type Super_String (Max_Length : Positive) is record Current_Length : Natural := 0; Data : String (1 .. Max_Length); -- ... comments only ... end record; Is it really possible to create less overhead? E.g., by using allocators, storage pools, and adding string operations as necessary? (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?)