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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,7e29322ee367c19d X-Google-Attributes: gid103376,public From: Bryce Bardin Subject: Re: Unchecked_Conversion on different sized types -- problem? Date: 2000/01/13 Message-ID: <387E574A.146BD794@home.com>#1/1 X-Deja-AN: 572311430 Content-Transfer-Encoding: 7bit References: X-Accept-Language: en,en-GB,en-US,fr,fr-BE,fr-CA,fr-FR,fr-CH,de,de-AT,de-DE,de-CH,it,es,es-AR,es-CO,es-MX,es-ES Content-Type: text/plain; charset=us-ascii X-Complaints-To: abuse@home.net X-Trace: news1.alsv1.occa.home.com 947803979 24.7.50.190 (Thu, 13 Jan 2000 14:52:59 PST) Organization: @Home Network MIME-Version: 1.0 NNTP-Posting-Date: Thu, 13 Jan 2000 14:52:59 PST Newsgroups: comp.lang.ada Date: 2000-01-13T00:00:00+00:00 List-Id: Mike Silva wrote: > type T is ( BLACK, WHITE ); > > for T use ( BLACK => 30, WHITE => 37 ); for T'Size use Integer'Size; > > function T_to_int is new Unchecked_Conversion( T, Integer ); > > T_val : T := BLACK; > > Text_IO.Put( Item => T_to_int( T_val )... > Mike But why use a representation clause for Color? type Color is ( Black, White ); -- for Color use ( Black => 30, White => 37 ); type String_Access is access String; Command : array (Color) of String_Access := (new String'("30"), new String'("37")); begin Text_Io.Put(Command(Color_Val).all);