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,3db17e1869f3a33d X-Google-Attributes: gid103376,public From: dewar@cs.nyu.edu (Robert Dewar) Subject: Re: Ada95 Streams Question Date: 1996/06/20 Message-ID: #1/1 X-Deja-AN: 161444979 references: <009A400CB5CAE623.78BE@smcsr3.smcs.se.baesema.co.uk> organization: Courant Institute of Mathematical Sciences newsgroups: comp.lang.ada Date: 1996-06-20T00:00:00+00:00 List-Id: 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.