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, 12 Sep 2017 18:58:53 +0200 Organization: Aioe.org NNTP Server Message-ID: References: <915874b5-52c0-4aa8-9023-82fddedb816f@googlegroups.com> <323ae5e6-f2ce-4a15-b874-906a670f331c@googlegroups.com> <35e49f52-16da-4f1a-b2e3-b8d07d736a0d@googlegroups.com> <800285a3-22de-4b22-a0bf-afc53bc1c1c6@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 Content-Language: en-US X-Notice: Filtered by postfilter v. 0.8.2 Xref: news.eternal-september.org comp.lang.ada:48071 Date: 2017-09-12T18:58:53+02:00 List-Id: On 2017-09-12 18:30, Shark8 wrote: > On Tuesday, September 12, 2017 at 4:07:27 AM UTC-6, Dmitry A. Kazakov wrote: >> >> No DB bindings I know deploy bounded-length strings. > > Isn't that a failing of those bindings? (Just like we could have a > thin C-binding which used return codes.) If you mean the side turned towards the DB, it is a requirement, since the counterpart is a char * or void *. If you mean the Ada interface's side, it is convenience. Bounded_Strings are difficult to use, while the advantage is zero. If the DB has a field constraint that is dynamic on the Ada side. There is no way you could push that constraint into the instance of Ada.Strings.Bounded. Since copying is involved anyway, there is no reason not to have Fetch (Column) just returning String of the actual length. Simple and clean. If we wanted in-place semantics, a stream is the answer. Fetch would supply chunks of data which are accumulated in the stream. There are lots of protocols working this way, e.g. HTTP's chunked transfer. The stream can be backed by a String on an embedded system or by a container of dynamically allocated memory chunks. Anyway, no good reason to use Ada.Strings.Bounded. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de