comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: Discriminant within discriminants
Date: Wed, 3 May 2006 16:05:08 -0500
Date: 2006-05-03T16:05:08-05:00	[thread overview]
Message-ID: <doqdnb4qCOVth8TZnZ2dnUVZ_vednZ2d@megapath.net> (raw)
In-Reply-To: M656g.929814$x96.584697@attbi_s72

"Jeffrey R. Carter" <spam.not.jrcarter@acm.not.spam.org> wrote in message
news:M656g.929814$x96.584697@attbi_s72...
...
> > QUESTION : can i declare a message with a type and size in the one
> > statement without using the intermediate message.
>
> Msg : Message_Types.In_Messages :=
>     (Kind => Message_Types.Dispense_Acknowledgement,
>      Acknowledgements =>
>         (Size => 8, Dispense_Acks => (1 .. 8 => Thing) ) );
>
> This requires that a value of the (undefined) type Acks be available
> (Thing in the example).

If you have Ada 2005 support, you can use the default initialization value
to avoid the need to specify a particular value:

Msg : Message_Types.In_Messages :=
     (Kind => Message_Types.Dispense_Acknowledgement,
      Acknowledgements =>
         (Size => 8, Dispense_Acks => (1 .. 8 => <>) ) );

                  Randy.





  reply	other threads:[~2006-05-03 21:05 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-03  1:49 Discriminant within discriminants stuart clark
2006-05-03 16:45 ` Jeffrey R. Carter
2006-05-03 21:05   ` Randy Brukardt [this message]
2006-05-04  0:14     ` stuart clark
2006-05-04  0:57       ` Jeffrey R. Carter
     [not found]         ` <4a9k52ha4ohqkcd01ghn6c7785d6pvf91e@4ax.com>
2006-05-04 17:57           ` Jeffrey R. Carter
2006-05-04  0:45     ` Jeffrey R. Carter
2006-05-05  9:03 ` Stephen Leake
replies disabled

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