From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.5-pre1 (2020-06-20) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-1.9 required=3.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.5-pre1 Path: eternal-september.org!reader02.eternal-september.org!news.gegeweb.eu!gegeweb.org!usenet-fr.net!proxad.net!feeder1-2.proxad.net!cleanfeed2-a.proxad.net!nnrp4-2.free.fr!not-for-mail Newsgroups: comp.lang.ada References: <607b5b20$0$27442$426a74cc@news.free.fr> <86mttuk5f0.fsf@stephe-leake.org> From: DrPi <314@drpi.fr> Subject: Re: Ada and Unicode Date: Mon, 19 Apr 2021 18:07:32 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.9.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Message-ID: <607daac7$0$6477$426a74cc@news.free.fr> Organization: Guest of ProXad - France NNTP-Posting-Date: 19 Apr 2021 18:07:35 CEST NNTP-Posting-Host: 82.65.30.55 X-Trace: 1618848455 news-1.free.fr 6477 82.65.30.55:59975 X-Complaints-To: abuse@proxad.net Xref: reader02.eternal-september.org comp.lang.ada:61851 List-Id: Le 19/04/2021 à 15:00, Luke A. Guest a écrit : > > > On 19/04/2021 13:52, Dmitry A. Kazakov wrote: > >> It is practical solution. Ada type system cannot express differently > represented/constrained string/array/vector subtypes. Ignoring Latin-1 > and using String as if it were an array of octets is the best available > solution. >> > > They're different types and should be incompatible, because, well, they > are. What does Ada have that allows for this that other languages > doesn't? Oh yeah! Types! I agree. In Python2, encoded and "decoded" strings are of same type "str". Bad design. In Python3, "decoded" strings are of type "str" and encoded strings are of type "bytes" (byte array). Both are different things and can't be assigned one to the other. Much more clear for the programmer. It should the same in Ada. Different types.