comp.lang.ada
 help / color / mirror / Atom feed
From: dewar@cs.nyu.edu (Robert Dewar)
Subject: Re: Ada95 Streams Question
Date: 1996/06/20
Date: 1996-06-20T00:00:00+00:00	[thread overview]
Message-ID: <dewar.835244146@schonberg> (raw)
In-Reply-To: qw6wx145a3d.fsf@gargantua.enst.fr


Sam said

"To be general, Ada compilers are free to use any representation of
streams. One may well choose raw conversions (as GNAT does) while
another one will adopt XDR encoding."

That's correct, as we see from 13.13.2

9   For elementary types, the representation in terms of stream elements is
implementation defined.  For composite types, the Write or Read attribute for
each component is called in a canonical order.  The canonical order of
components is last dimension varying fastest for an array, and positional
aggregate order for a record.  Bounds are not included in the stream if T is
an array type.  If T is a discriminated type, discriminants are included only
if they have defaults.  If T is a tagged type, the tag is not included.


GNAT by default follows the implementation advice in paragaph 17

17   If a stream element is the same size as a storage element, then the
normal in-memory representation should be used by Read and Write for scalar
objects.  Otherwise, Read and Write should use the smallest number of stream
elements needed to represent all values in the base range of the scalar type.


However, this is easily changed, the library package System.Stream_Attributes
(in files s-stratt.ads/adb) comletely define the implementation choice for
representation of elementary types, and this unit is easily replaced, e.g.
by one that uses XDR or some other canonical representation.





  reply	other threads:[~1996-06-20  0:00 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-06-17  0:00 Ada95 Streams Question Chris.Morgan
1996-06-18  0:00 ` Robert I. Eachus
1996-06-19  0:00 ` Samuel Tardieu
1996-06-20  0:00   ` Robert Dewar [this message]
  -- strict thread matches above, loose matches on Subject: below --
1996-06-23  0:00 Robert Dewar
1996-06-24  0:00 ` michael
1996-06-24  0:00   ` Laurent Pautet
1996-06-24  0:00   ` Robert Dewar
1996-06-28  0:00     ` Robert A Duff
1996-06-30  0:00       ` Robert Dewar
1996-06-28  0:00     ` michael
1996-06-28  0:00       ` Robert Dewar
1996-07-01  0:00         ` Laurent Pautet
1996-07-01  0:00           ` Robert Dewar
1996-07-02  0:00     ` sam
1996-06-25  0:00   ` Theodore E. Dennison
1996-06-24  0:00 Chris.Morgan
replies disabled

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