From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,8a34575d5eb275cb X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!postnews.google.com!q16g2000yqg.googlegroups.com!not-for-mail From: Ludovic Brenta Newsgroups: comp.lang.ada Subject: Re: Load an object from a file Date: Fri, 3 Apr 2009 09:22:39 -0700 (PDT) Organization: http://groups.google.com Message-ID: <643e14cf-6605-4316-ae3f-e1787c8255ef@q16g2000yqg.googlegroups.com> References: <49d5fa88$0$2862$ba620e4c@news.skynet.be> <443d72ca-5bbd-46a3-84c6-e8bd984e5b80@k41g2000yqh.googlegroups.com> <49d628f5$0$2865$ba620e4c@news.skynet.be> <49d6346e$0$32681$9b4e6d93@newsspool2.arcor-online.net> NNTP-Posting-Host: 94.108.129.105 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1238775764 16696 127.0.0.1 (3 Apr 2009 16:22:44 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Fri, 3 Apr 2009 16:22:44 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: q16g2000yqg.googlegroups.com; posting-host=94.108.129.105; posting-account=pcLQNgkAAAD9TrXkhkIgiY6-MDtJjIlC User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.0.7) Gecko/2009030810 Iceweasel/3.0.7 (Debian-3.0.7-1),gzip(gfe),gzip(gfe) Xref: g2news2.google.com comp.lang.ada:5395 Date: 2009-04-03T09:22:39-07:00 List-Id: Georg Bauhaus wrote on comp.lang.ada: > Olivier Scalbert schrieb: > > > Thanks Ludovic, > > > One more question: > > > with: > > =A0 =A0 type u2 is new Integer; > > =A0 =A0 type cp_info is new Integer; > > > =A0 =A0 type Constant_Pool_Array is array (Positive range <>) of cp_inf= o; > > =A0 =A0 type Interfaces_Array is array (Positive range <>) of u2; > > Make the index type the same as the type in the disciminant, > that is, u2. > > =A0 =A0type Constant_Pool_Array is array (u2 range <>) of cp_info; > =A0 =A0type 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. =A0Perhaps 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.