From: Thomas <fantome.forums.tDeContes@free.fr.invalid>
Subject: Re: Ada and Unicode
Date: Sun, 03 Apr 2022 20:04:36 +0200 [thread overview]
Message-ID: <fantome.forums.tDeContes-E8EAB8.20043603042022@news.free.fr> (raw)
In-Reply-To: s5k0ai$bb5$1@dont-email.me
In article <s5k0ai$bb5$1@dont-email.me>, "J-P. Rosen" <rosen@adalog.fr>
wrote:
> Le 19/04/2021 à 15:00, Luke A. Guest a écrit :
> > 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!
>
> They are not so different. For example, you may read the first line of a
> file in a string, then discover that it starts with a BOM, and thus
> decide it is UTF-8.
could you give me an example of sth that you can do yet, and you could
not do if UTF_8_String was private, please?
(to discover that it starts with a BOM, you must look at it.)
>
> BTW, the very first version of this AI had different types, but the ARG
> felt that it would just complicate the interface for the sake of abusive
> "purity".
could you explain "abusive purity" please?
i guess it is because of ASCII.
i guess a lot of developpers use only ASCII in a lot of situation, and
they would find annoying to need Ada.Strings.UTF_Encoding.Strings every
time.
but I think a simple explicit conversion is acceptable, for a not fully
compatible type which requires some attention.
the best would be to be required to use ASCII_String as intermediate,
but i don't know how it could be designed at language level:
UTF_8_Var := UTF_8_String (ASCII_String (Latin_1_Var));
Latin_1_Var:= String (ASCII_String (UTF_8_Var));
and this would be forbidden :
UTF_8_Var := UTF_8_String (Latin_1_Var);
this would ensures to raise Constraint_Error when there are somme
non-ASCII characters.
--
RAPID maintainer
http://savannah.nongnu.org/projects/rapid/
next prev parent reply other threads:[~2022-04-03 18:04 UTC|newest]
Thread overview: 63+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-17 22:03 Ada and Unicode DrPi
2021-04-18 0:02 ` Luke A. Guest
2021-04-19 9:09 ` DrPi
2021-04-19 8:29 ` Maxim Reznik
2021-04-19 9:28 ` DrPi
2021-04-19 13:50 ` Maxim Reznik
2021-04-19 15:51 ` DrPi
2021-04-19 11:15 ` Simon Wright
2021-04-19 11:50 ` Luke A. Guest
2021-04-19 15:53 ` DrPi
2022-04-03 19:20 ` Thomas
2022-04-04 6:10 ` Vadim Godunko
2022-04-04 14:19 ` Simon Wright
2022-04-04 15:11 ` Simon Wright
2022-04-05 7:59 ` Vadim Godunko
2022-04-08 9:01 ` Simon Wright
2023-03-30 23:35 ` Thomas
2022-04-04 14:33 ` Simon Wright
2021-04-19 9:08 ` Stephen Leake
2021-04-19 9:34 ` Dmitry A. Kazakov
2021-04-19 11:56 ` Luke A. Guest
2021-04-19 12:13 ` Luke A. Guest
2021-04-19 15:48 ` DrPi
2021-04-19 12:52 ` Dmitry A. Kazakov
2021-04-19 13:00 ` Luke A. Guest
2021-04-19 13:10 ` Dmitry A. Kazakov
2021-04-19 13:15 ` Luke A. Guest
2021-04-19 13:31 ` Dmitry A. Kazakov
2022-04-03 17:24 ` Thomas
2021-04-19 13:24 ` J-P. Rosen
2021-04-20 19:13 ` Randy Brukardt
2022-04-03 18:04 ` Thomas [this message]
2022-04-06 18:57 ` J-P. Rosen
2022-04-07 1:30 ` Randy Brukardt
2022-04-08 8:56 ` Simon Wright
2022-04-08 9:26 ` Dmitry A. Kazakov
2022-04-08 19:19 ` Simon Wright
2022-04-08 19:45 ` Dmitry A. Kazakov
2022-04-09 4:05 ` Randy Brukardt
2022-04-09 7:43 ` Simon Wright
2022-04-09 10:27 ` DrPi
2022-04-09 16:46 ` Dennis Lee Bieber
2022-04-09 18:59 ` DrPi
2022-04-10 5:58 ` Vadim Godunko
2022-04-10 18:59 ` DrPi
2022-04-12 6:13 ` Randy Brukardt
2021-04-19 16:07 ` DrPi
2021-04-20 19:06 ` Randy Brukardt
2022-04-03 18:37 ` Thomas
2022-04-04 23:52 ` Randy Brukardt
2023-03-31 3:06 ` Thomas
2023-04-01 10:18 ` Randy Brukardt
2021-04-19 16:14 ` DrPi
2021-04-19 17:12 ` Björn Lundin
2021-04-19 19:44 ` DrPi
2022-04-16 2:32 ` Thomas
2021-04-19 13:18 ` Vadim Godunko
2022-04-03 16:51 ` Thomas
2023-04-04 0:02 ` Thomas
2021-04-19 22:40 ` Shark8
2021-04-20 15:05 ` Simon Wright
2021-04-20 19:17 ` Randy Brukardt
2021-04-20 20:04 ` Simon Wright
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox