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,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.31.33.86 with SMTP id h83mr7498580vkh.112.1505225272737; Tue, 12 Sep 2017 07:07:52 -0700 (PDT) X-Received: by 10.36.9.209 with SMTP id 200mr87itm.1.1505225272648; Tue, 12 Sep 2017 07:07:52 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!border1.nntp.ams1.giganews.com!border2.nntp.ams1.giganews.com!nntp.giganews.com!peer03.ams1!peer.ams1.xlned.com!news.xlned.com!peer01.am4!peer.am4.highwinds-media.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!q8no2855797qtb.0!news-out.google.com!p6ni1095itp.0!nntp.google.com!127no343567itw.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Tue, 12 Sep 2017 07:07:52 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=193.71.175.207; posting-account=uulyKwoAAAA86DO0ODu--rZtbje8Sytn NNTP-Posting-Host: 193.71.175.207 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> <5126ef7a-3324-4e44-b110-5e4838189f5f@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <98c3bae5-67a7-4502-8019-7661ae514ab3@googlegroups.com> Subject: Re: Community Input for the Maintenance and Revision of the Ada Programming Language From: Egil H H Injection-Date: Tue, 12 Sep 2017 14:07:52 +0000 Content-Type: text/plain; charset="UTF-8" X-Received-Body-CRC: 3560423732 X-Received-Bytes: 3007 Xref: news.eternal-september.org comp.lang.ada:48058 Date: 2017-09-12T07:07:52-07:00 List-Id: On Tuesday, September 12, 2017 at 3:43:40 PM UTC+2, Dmitry A. Kazakov wrote: > So it can do with the custom type: > > with Ada.Text_IO; use Ada.Text_IO; > procedure Test is > Max : constant := 1000; > subtype Max_Length is Natural range 0..Max; > type Bounded (Size : Max_Length := Max_Length'Last) is record > Length : Max_Length := 0; > Text : String (1..Size); > end record; > function Value (S : Bounded) return String is > begin > return S.Text (1..S.Length); > end Value; > procedure Set (S : in out Bounded; Value : String) is > begin > S.Length := Value'Length; > S.Text (1..Value'Length) := Value; > end Set; > X : Bounded; > Y : Bounded (10); > begin > Set (X, "0123456789ABCDEFGH"); > Put_Line ("X=" & Value (X)); > Set (Y, "abc"); > X := Y; > Put_Line ("X=" & Value (X)); > end Test; > ...and you _really_ don't see the value of having all this (and lots more) in _one_ place, implemented _once_, tried and tested?