* Unicode identifier and Wide_Value
@ 2006-07-13 17:46 Y.Tomino
2006-07-14 3:17 ` Randy Brukardt
0 siblings, 1 reply; 2+ messages in thread
From: Y.Tomino @ 2006-07-13 17:46 UTC (permalink / raw)
Hello.
Ada2005 supports Unicode Identifier, and I tried to use it.
It's convenience to convert enum-values <=> strings.
Wide_Image works, but Wide_Value(Wide_Image(x)) raises Constraint_Error.
Test:
with Ada.Text_IO;
procedure Test is
type T is (あ); -- Japanease letter like A
I : Wide_String := T'Wide_Image(T'First);
S : T := T'Wide_Value(I);
begin
null;
end Test;
>gnatmake -gnat05 -gnatW8 test
gcc -c -gnat05 -gnatW8 test.adb
gnatbind -x test.ali
gnatlink test.ali
>test
raised CONSTRAINT_ERROR : s-valenu.adb:75 explicit raise
But bracket literal ["3042"] works correctly. Wide_Image and Wide_Value
are OK........
???
--
YT
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Unicode identifier and Wide_Value
2006-07-13 17:46 Unicode identifier and Wide_Value Y.Tomino
@ 2006-07-14 3:17 ` Randy Brukardt
0 siblings, 0 replies; 2+ messages in thread
From: Randy Brukardt @ 2006-07-14 3:17 UTC (permalink / raw)
"Y.Tomino" <demoonlit@panathenaia.halfmoon.jp> wrote in message
news:e960tm$56c$2@news521.nifty.com...
> Hello.
>
> Ada2005 supports Unicode Identifier, and I tried to use it.
> It's convenience to convert enum-values <=> strings.
> Wide_Image works, but Wide_Value(Wide_Image(x)) raises Constraint_Error.
This sounds like a compiler bug; there's likely to be a lot of them in Ada
2005 compilers (they're new, after all).
But please remember that "Ada" is a programming language, not an
implementation. You need to specify what implementation you're using when
asking here about program behavior, because it's quite likely that someone
else will have run into the problem.
Randy Brukardt
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2006-07-14 3:17 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-07-13 17:46 Unicode identifier and Wide_Value Y.Tomino
2006-07-14 3:17 ` Randy Brukardt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox