comp.lang.ada
 help / color / mirror / Atom feed
From: Ludovic Brenta <ludovic@ludovic-brenta.org>
Subject: Re: Load an object from a file
Date: Fri, 3 Apr 2009 09:22:39 -0700 (PDT)
Date: 2009-04-03T09:22:39-07:00	[thread overview]
Message-ID: <643e14cf-6605-4316-ae3f-e1787c8255ef@q16g2000yqg.googlegroups.com> (raw)
In-Reply-To: 49d6346e$0$32681$9b4e6d93@newsspool2.arcor-online.net

Georg Bauhaus wrote on comp.lang.ada:
> Olivier Scalbert schrieb:
>
> > Thanks Ludovic,
>
> > One more question:
>
> > with:
> >     type u2 is new Integer;
> >     type cp_info is new Integer;
>
> >     type Constant_Pool_Array is array (Positive range <>) of cp_info;
> >     type Interfaces_Array is array (Positive range <>) of u2;
>
> Make the index type the same as the type in the disciminant,
> that is, u2.
>
>    type Constant_Pool_Array is array (u2 range <>) of cp_info;
>    type Interfaces_Array is array (u2 range <>) of u2;
>
> since U2 is the type of the discriminants used in providing
> the array bounds.
>
> In fact, very likely the type U2 is range 0 .. Something, with
> Java's integer type semantics regarding overflow and wrap
> around.  Perhaps it is a good idea to express this in Ada
> for U2 as well.

Right; in fact, Java's u2 probably corresponds to

type u2 is mod 2 ** 32; -- or perhaps 64?

--
Ludovic Brenta.



  reply	other threads:[~2009-04-03 16:22 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-03 12:01 Load an object from a file Olivier Scalbert
2009-04-03 13:07 ` Niklas Holsti
2009-04-03 13:37 ` Ludovic Brenta
2009-04-03 15:19   ` Olivier Scalbert
2009-04-03 16:08     ` Georg Bauhaus
2009-04-03 16:22       ` Ludovic Brenta [this message]
2009-04-03 16:41         ` Olivier Scalbert
2009-04-03 16:46       ` Adam Beneschan
2009-04-03 20:22         ` Ludovic Brenta
2009-04-09 20:32   ` Olivier Scalbert
2009-04-09 21:22     ` Ludovic Brenta
2009-04-09 22:22       ` Olivier Scalbert
2009-04-19 13:08   ` Olivier Scalbert
2009-04-19 19:52     ` Ludovic Brenta
2009-04-19 20:27     ` Gautier
2009-04-03 13:41 ` Thomas Løcke
replies disabled

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