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=-2.3 required=5.0 tests=BAYES_00,INVALID_MSGID, MAILING_LIST_MULTI autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,2e66fe8b30e3ee2c X-Google-Attributes: gid103376,public From: Mario Amado Alves Subject: Re: S'Write and How To Count Bytes Date: 2000/10/03 Message-ID: #1/1 X-Deja-AN: 676989899 To: comp.lang.ada@ada.eu.org X-Authentication-Warning: lexis.di.fct.unl.pt: maa owned process doing -bs Content-Type: TEXT/PLAIN; charset=US-ASCII X-Complaints-To: usenet@enst.fr X-Trace: menuisier.enst.fr 970570983 9769 137.194.161.2 (3 Oct 2000 11:03:03 GMT) Organization: ENST, France List-Id: comp.lang.ada mail<->news gateway X-Mailman-Version: 2.0beta5 X-BeenThere: comp.lang.ada@ada.eu.org Mime-Version: 1.0 Reply-To: comp.lang.ada@ada.eu.org NNTP-Posting-Date: 3 Oct 2000 11:03:03 GMT Newsgroups: comp.lang.ada Date: 2000-10-03T11:03:03+00:00 The "bottom line" was very simple: you may define the representation in primary storage but not in secondary. This is what the ARM prescribes. I also would like to see this changed in Ada20XX. On Mon, 2 Oct 2000 tmoran@bix.com wrote: > >... I will get out what I expect. > type Temperature is new Integer range 60 .. 80; > for Temperature'size use 8; -- or 7 > Is a Temperature'Write going to produce one byte, because that's how > big Temperature is, or 4 bytes, because that's how big Integer is? > type R is record > Speed : Long_Integer; > end record; > for R use record > S at 0 range 0 .. 7; > end record; > Will an R'Write produce one byte for S, or 8 or what? > > >A perfect solution would be controlled representation of the (tagged) > >record types and a fast overlay of a Stream_Element_Array. > I remember this discussion, but not the bottom line. What's wrong > with > TAG_SIZE : constant := 4; > ... > type This_Buffer is new Buffer with record > Speed : Integer; > T : Temperature; > end record; > for This_Buffer use record > Speed at TAG_SIZE range 0 .. 7; > T at Tag_Size+1 range 0 .. 7; > end record; > and then overlay a Stream_Element_Array? (Or a > System.Storage_Elements.Storage_Array?) > I'd rather trust to TAG_SIZE being 4, or at least a single thing to > change, as I move between compilers, rather than trusting Stream stuff. > | |,| | | |RuaFranciscoTaborda24RcD 2815-249CharnecaCaparica 351+939354002 |M|A|R|I|O| |A|M|A|D|O|DepartmentoDeInformaticaFCT/UNL 2825-114 Caparica 351+212958536 |A|L|V|E|S| fax 212948541 | | | | | | maa@di.fct.unl.pt FCT 212948300