comp.lang.ada
 help / color / mirror / Atom feed
From: Stephen Leake <Stephe.Leake@nasa.gov>
Subject: Re: How to define an array of a variant record type?
Date: 17 Nov 2003 12:35:34 -0500
Date: 2003-11-17T17:39:46+00:00	[thread overview]
Message-ID: <ullqe6gpl.fsf@nasa.gov> (raw)
In-Reply-To: BBDEBC6C.902D%office@anobject.net

Harald Schmidt <office@anobject.net> writes:

>    type Name_Value_Type is (String_Type,
>                             Integer_Type,
>                             Float_Type);
> 
>    type Name_Value(Value_Type : Name_Value_Type) is

change this to

type Name_Value(Value_Type : Name_Value_Type := String_Type) is


This seems very odd, but it works. It says to the compiler "let the
discriminant change at runtime". Without the default value for the
discriminant, the discriminant is _not_ allowed to change at runtime;
it must be known at compile time.

-- 
-- Stephe



  reply	other threads:[~2003-11-17 17:35 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-11-17 16:57 How to define an array of a variant record type? Harald Schmidt
2003-11-17 17:35 ` Stephen Leake [this message]
2003-11-20 10:02   ` Craig Carey
2003-11-17 17:37 ` Marius Amado Alves
2003-11-18  2:48   ` Steve
2003-11-18  9:04     ` Marius Amado Alves
2003-11-17 18:45 ` Rodrigo Garcia
2003-11-18  2:48 ` Steve
2003-11-18 17:48 ` Nick Roberts
2003-11-19  2:38   ` Steve
2003-11-19  8:11     ` Preben Randhol
2003-11-19 13:26   ` Rodrigo Garcia
replies disabled

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