comp.lang.ada
 help / color / mirror / Atom feed
From: James Rogers <jimmaureenrogers@att.net>
Subject: Re: Type declared in record?
Date: Wed, 12 Nov 2003 04:17:41 GMT
Date: 2003-11-12T04:17:41+00:00	[thread overview]
Message-ID: <Xns9430D893E42E9jimmaureenrogers@204.127.36.1> (raw)
In-Reply-To: pan.2003.11.11.20.25.14.453080.936@nospam.net

Freejack <user@nospam.net> wrote in 
news:pan.2003.11.11.20.25.14.453080.936@nospam.net:

> When using Ada records, is there a way to do something like this...
> 
>      type Foo is record
>           type Bar is array(1..Blah) of Positive;
>           Foo1 : Natural;
>           Foo2 : Natural;
>           <ect...>
>      end record;
> 
> I know I can achieve the same(or a similiar) effect using a tagged type.
> I was just curious if the above approach is possible, if there was a type
> constraint that could be placed on type Bar that would garauntee a
> correct elaboration at either compile time or run-time.
>

type Bar is array(Positive range <>) of Positive;

type Foo (Blah : Positive) is record
   Bar1 : Bar(1..Blah);
   Foo1 : Natural;
   Foo2 : Natural;
   <etc...>
end record;

Jim Rogers



      parent reply	other threads:[~2003-11-12  4:17 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-11-11 20:19 Type declared in record? Freejack
2003-11-11 22:08 ` Marius Amado Alves
2003-11-11 22:43   ` Freejack
2003-11-12  8:49     ` Dmitry A. Kazakov
2003-11-12  4:17 ` James Rogers [this message]
replies disabled

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