comp.lang.ada
 help / color / mirror / Atom feed
From: Bryce Bardin <bbardin@home.com>
Subject: Re: Unchecked_Conversion on different sized types -- problem?
Date: 2000/01/13
Date: 2000-01-13T00:00:00+00:00	[thread overview]
Message-ID: <387E574A.146BD794@home.com> (raw)
In-Reply-To: qXpf4.429$dw3.15200@news.wenet.net

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);




  reply	other threads:[~2000-01-13  0:00 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-01-13  0:00 Unchecked_Conversion on different sized types -- problem? Mike Silva
2000-01-13  0:00 ` Bryce Bardin [this message]
2000-01-13  0:00   ` Mike Silva
2000-01-13  0:00     ` Mike Silva
2000-01-14  0:00       ` Bryce Bardin
2000-01-14  0:00         ` Mike Silva
2000-01-14  0:00   ` Matthew Heaney
2000-01-13  0:00 ` reason67
2000-01-13  0:00 ` Jim Rogers
2000-01-13  0:00   ` Mike Silva
2000-01-13  0:00     ` James S. Rogers
2000-01-14  0:00 ` Keith Thompson
2000-01-16  0:00   ` David A. Cobb
2000-01-14  0:00 ` Wrap-Up (was Re: Unchecked_Conversion on different sized types -- problem?) Mike Silva
2000-01-15  0:00   ` Matthew Heaney
2000-01-15  0:00     ` Robert A Duff
2000-01-14  0:00 ` Unchecked_Conversion on different sized types -- problem? Vladimir Olensky
2000-01-14  0:00 ` Jeff Carter
2000-01-14  0:00 ` Werner Pachler
2000-01-14  0:00   ` Bryce Bardin
2000-01-14  0:00   ` reason67
replies disabled

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