TEAM-ADA Archives

Team Ada: Ada Programming Language Advocacy

TEAM-ADA@LISTSERV.ACM.ORG

Options: Use Forum View

Use Proportional Font
Show HTML Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
"W. Wesley Groleau x4923" <[log in to unmask]>
Reply To:
W. Wesley Groleau x4923
Date:
Thu, 12 Nov 1998 09:30:30 -0500
Content-Type:
text/plain
Parts/Attachments:
text/plain (29 lines)
> For Ada we would write
>    type Jint is range -2**31 .. 2**31 - 1;
>    for Jint'Size use 32;

Or how about:

package Interfaces.Java is
   ...
   type int is .....

> And this will work on any platform where the Ada compiler
> can handle 32 bit numbers.

Actually, I have seen at least one Ada _83_ compiler that could handle
32-bit numbers, but could not handle the above declaration.  Due to
precedence rules, they felt they had to compute 2**31 first, and then
print

   type ..... is range -2**31 .. 2**31 - 1;
                        ^        ^
   (cryptic message that has something to do with available machine types)

The ugly workaround was

   Big_Number : constant := 2**30;

   type ..... is range (- Big_Number - Big_Number)      ..
                       ((Big_Number - 1) + Big_Number);

ATOM RSS1 RSS2