comp.lang.ada
 help / color / mirror / Atom feed
From: convergence82 <tiamiata@gmail.com>
Subject: Re: (Num_Types.Mod_4 range 1..8) ------->why not (1..8)?
Date: Mon, 18 May 2009 12:58:27 -0700 (PDT)
Date: 2009-05-18T12:58:27-07:00	[thread overview]
Message-ID: <6b5fe400-2564-4fc9-a5bf-f83d1e476345@q14g2000vbn.googlegroups.com> (raw)
In-Reply-To: 4a11b8cb$0$32680$9b4e6d93@newsspool2.arcor-online.net

On May 18, 3:36 pm, Georg Bauhaus <rm.tsoh.plus-
bug.bauh...@maps.futureapps.de> wrote:
> convergence82 wrote:
> >    type Data_Array is array (Num_Types.Mod_4 range 1..8) of
> > Num_Types.Mod_8;
>
> > what's the difference between this and:
>
> >    type Data_Array is array (1..8) of Num_Types.Mod_8;
>
> > ?
>
> Mod_4 range 1 .. 8 denotes a range of values in type Mod_4.
> The index range will be taken from type Mod_4.
> 1 .. 8 without the Mod_4 denotes a range of numbers from
> a "less specific" index type, determined by the rules of
> the language -- probably Integer.  The details are found in
> and linked from RM 3.6.

Thanks.  I'm looking at a Ada.Unchecked_Conversion function that
converts from Data_Array_1 to Data_Array_2:

type Data_Array_1 is array (Num_Types.Mod_4 range 1..8) of
Num_Types.Mod_8;
type Data_Array_2 is array (1..8) of Num_Types.Mod_8;

I would think that the way the array is indexed is (integer, mod_4, or
whatever) wouldn't matter (it's the datatype of the elements of the
array that matter).

So, will the convert function really in effect DO NOTHING but copy the
data over?

Steph



  reply	other threads:[~2009-05-18 19:58 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-18 19:19 (Num_Types.Mod_4 range 1..8) ------->why not (1..8)? convergence82
2009-05-18 19:36 ` Georg Bauhaus
2009-05-18 19:58   ` convergence82 [this message]
2009-05-18 20:50     ` Adam Beneschan
2009-05-18 20:53     ` Georg Bauhaus
2009-05-18 21:12       ` convergence82
2009-05-18 21:24       ` Adam Beneschan
2009-05-19  6:26         ` christoph.grein
2009-05-19  7:47           ` Petter
2009-05-19  8:04             ` christoph.grein
2009-05-19 13:13               ` Petter
2009-05-19 15:27                 ` Georg Bauhaus
2009-05-19 17:53           ` Adam Beneschan
2009-05-18 19:49 ` Robert A Duff
replies disabled

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