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.3 required=5.0 tests=BAYES_00,INVALID_MSGID
autolearn=no autolearn_force=no version=3.4.4
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 103376,6d51a4400ccde5d8
X-Google-Attributes: gid103376,public
From: tmoran@bix.com
Subject: Re: Ada/Java
Date: 1997/04/25
Message-ID: <5jqfdb$80v@lotho.delphi.com>#1/1
X-Deja-AN: 237293385
Organization: Delphi Internet Services
Newsgroups: comp.lang.ada
Date: 1997-04-25T00:00:00+00:00
List-Id:
> > > > Must each record be a class? Not all Ada records are tagged types.
> > >
> > > Java does not support any other kind of first class object which has
> > > structure.
> > So, at the Jave byte code level there is no structure larger than
> > "words"?
>
> You've lost me. The basic point is that you want your Ada to fit in
> as transparently as possible with any stuff generated from Java (the
> language).
Consider two ways of making a Point
type Coordinates is (X,Y);
type Point is array(Coordinates) of Integer;
vs
type Point is record
X : Integer;
Y : Integer;
end record;
If I write "Starting_Point(X) := 0;" for the first, or
"Starting_Point.X := 0;" for the second, I would expect rather similar
instructions to be generated at the (virtual) machine code level. But
in Jave these are very different - the second (record) approach apparently
requires a whole additional file. My question is "why can't the compiler
recognize that the record approach is similar to the array approach and
use the much less expensive array style?". I gather the answer is that
the Java byte code for some reason does not allow this.