comp.lang.ada
 help / color / mirror / Atom feed
* Question about Ada.Unchecked_Conversion
@ 2004-10-29 12:46 Eric Jacoboni
  2004-10-29 14:22 ` Dmitry A. Kazakov
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Eric Jacoboni @ 2004-10-29 12:46 UTC (permalink / raw)


Hi

There is something i've probably not understood about
Ada.Unchecked_Conversion behavior, despite readings of Barnes and
RM95.

To illustrate my pb, let a String in which i want to count
various separators :

subtype T_Phrase is String(1..Lg_Max);
   
type T_S�parateur is (' ', Ht, Lf, ',' ,';', ':', '.', '?', '!');
for T_S�parateur'Size use Character'Size;

function Char_To_S�parateur is 
      new Ada.Unchecked_Conversion(Character, T_S�parateur);

Ma_Phrase : T_Phrase;

What i want to do is simply a test like this, in order to find
characters that are also separators:

if Char_To_S�parateur(Ma_Phrase(I)) in T_S�parateur then 
  ...
end if;

But this test always fails and i don't understand why. The logic seems
correct so i suppose it's a misunderstanding of Unchecked_Conversion?

Any clue?
-- 
�ric Jacoboni, n� il y a 1402497600 secondes



^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2004-10-30 17:18 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-10-29 12:46 Question about Ada.Unchecked_Conversion Eric Jacoboni
2004-10-29 14:22 ` Dmitry A. Kazakov
2004-10-29 14:26 ` Jean-Pierre Rosen
2004-10-29 15:15 ` Nick Roberts
2004-10-29 15:47   ` Eric Jacoboni
2004-10-30 10:23     ` skidmarks
2004-10-30 16:30       ` Nick Roberts
2004-10-30 17:18         ` Eric Jacoboni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox