comp.lang.ada
 help / color / mirror / Atom feed
* Determining value of record discriminant
@ 2010-07-19 22:36 deadlyhead
  2010-07-20  0:26 ` Jeffrey R. Carter
  0 siblings, 1 reply; 4+ messages in thread
From: deadlyhead @ 2010-07-19 22:36 UTC (permalink / raw)


Say I have a discriminated record with the following definition


--  code begins
type Discrim_Val is (Int, Str);

type Discrim_Rec (D : Discrim_Val) is record
   case D is
      when Int =>
         Val_Int : Integer := 1_000_000;
      when Str =>
         Val_Str : String (1 .. 11) := "One million";
   end case;
end record;
--  code ends


Is there any way to determine what the discriminant value was on a
type later on, i.e. with a dynamically allocated Discrim_Rec object
created with user input for D?  A haven't found anything looking
through the RM about attributes or anything providing this
functionality.

Thanks!
-- deadlyhead



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

end of thread, other threads:[~2010-07-20  8:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-07-19 22:36 Determining value of record discriminant deadlyhead
2010-07-20  0:26 ` Jeffrey R. Carter
2010-07-20  0:33   ` deadlyhead
2010-07-20  8:53   ` Maciej Sobczak

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