TEAM-ADA Archives

Team Ada: Ada Programming Language Advocacy

TEAM-ADA@LISTSERV.ACM.ORG

Options: Use Classic View

Use Monospaced Font
Show Text Part by Default
Condense Mail Headers

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

Print Reply
Sender: "Team Ada: Ada Advocacy Issues (83 & 95)" <[log in to unmask]>
From: "W. Wesley Groleau x4923" <[log in to unmask]>
Date: Thu, 12 Nov 1998 09:30:30 -0500
Reply-To: "W. Wesley Groleau x4923" <[log in to unmask]>
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