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,2e66fe8b30e3ee2c X-Google-Attributes: gid103376,public From: tmoran@bix.com Subject: Re: S'Write and How To Count Bytes Date: 2000/10/02 Message-ID: <878C5.275815$i5.3825407@news1.frmt1.sfba.home.com>#1/1 X-Deja-AN: 676815415 Referecnes: <39D8EDFF.CCDEFD7F@acm.org> X-Complaints-To: abuse@home.net X-Trace: news1.frmt1.sfba.home.com 970526276 24.20.190.201 (Mon, 02 Oct 2000 15:37:56 PDT) Organization: @Home Network NNTP-Posting-Date: Mon, 02 Oct 2000 15:37:56 PDT Newsgroups: comp.lang.ada Date: 2000-10-02T00:00:00+00:00 List-Id: >... 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.