comp.lang.ada
 help / color / mirror / Atom feed
* 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

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