comp.lang.ada
 help / color / mirror / Atom feed
From: Adam Beneschan <adam@irvine.com>
Subject: Re: (Num_Types.Mod_4 range 1..8) ------->why not (1..8)?
Date: Mon, 18 May 2009 13:50:06 -0700 (PDT)
Date: 2009-05-18T13:50:06-07:00	[thread overview]
Message-ID: <df95783c-dc43-47fe-a4b4-2c4011d6b720@v23g2000pro.googlegroups.com> (raw)
In-Reply-To: 6b5fe400-2564-4fc9-a5bf-f83d1e476345@q14g2000vbn.googlegroups.com

On May 18, 12:58 pm, convergence82 <tiami...@gmail.com> wrote:

> 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?

Yes.  In this case, though, a normal type conversion should work.
There's no reason to use Unchecked_Conversion.

                                       -- Adam



  reply	other threads:[~2009-05-18 20:50 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
2009-05-18 20:50     ` Adam Beneschan [this message]
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