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: Wed, 13 Sep 2017 09:24:53 +0200 Organization: Aioe.org NNTP Server Message-ID: References: <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> <3c76c2ed-319f-410c-8dec-6a80a0948c7a@googlegroups.com> <1c8a3a96-1cdb-4c16-9c25-2da9bbf52cc9@googlegroups.com> <4bebca5c-5044-457b-b623-9c79da90945f@googlegroups.com> <83bcc588-4762-47f5-9130-74faa7d9c25d@googlegroups.com> NNTP-Posting-Host: vZYCW951TbFitc4GdEwQJg.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 6.1; 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:48096 Date: 2017-09-13T09:24:53+02:00 List-Id: On 12/09/2017 21:58, Egil H H wrote: > On Tuesday, September 12, 2017 at 9:14:50 PM UTC+2, Dmitry A. Kazakov wrote: >>> >>> Ah, so yo want to give up type safety... those are different types, >>> instantiated for different purposes. >> Sure, like >> >> X : String (1..1000); >> Y : String (1..10); >> > > You still can't do > X := Y; Of course I can it is the same type. > so why would you expect Bounded_String to behave that way? Because the contracts of ":=" of fixed- and variable-length strings are different. Fixed-length string assignment cannot change length, as the type name suggests. So the contract is that if the lengths are different Constraint_Error is propagated. For bounded-length strings the contract is that the length may not exceed the bound. So the contract is that Constraint_Error to propagate only then. For unbounded-length strings the contract is no Constraint_Error at all, but Storage_Error to propagate when it is impossible to assign. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de