From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,e037e74567eca23d,start X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!news2.google.com!proxad.net!teaser.fr!not-for-mail From: Eric Jacoboni Newsgroups: comp.lang.ada Subject: Question about Ada.Unchecked_Conversion Date: Fri, 29 Oct 2004 14:46:54 +0200 Organization: Rogntutdju & Associates Message-ID: NNTP-Posting-Host: titine.scrogneugneu.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: feed.teaser.net 1099054020 70344 81.56.238.119 (29 Oct 2004 12:47:00 GMT) X-Complaints-To: abuse@teaser.fr NNTP-Posting-Date: Fri, 29 Oct 2004 12:47:00 +0000 (UTC) X-Attribution: Jaco User-Agent: Gnus/5.110003 (No Gnus v0.3) Emacs/21.3.50 (darwin) Cancel-Lock: sha1:KSZ895VNSwEjJxGluwAwSCbNvL8= Xref: g2news1.google.com comp.lang.ada:5854 Date: 2004-10-29T14:46:54+02:00 List-Id: 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