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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,adb01e044e3e5aec X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-01-31 10:40:48 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!arclight.uoregon.edu!wn13feed!worldnet.att.net!204.127.198.203!attbi_feed3!attbi_feed4!attbi.com!sccrnsc03.POSTED!not-for-mail From: tmoran@acm.org Newsgroups: comp.lang.ada Subject: Re: Hints for networking References: X-Newsreader: Tom's custom newsreader Message-ID: NNTP-Posting-Host: 12.234.13.56 X-Complaints-To: abuse@attbi.com X-Trace: sccrnsc03 1044038448 12.234.13.56 (Fri, 31 Jan 2003 18:40:48 GMT) NNTP-Posting-Date: Fri, 31 Jan 2003 18:40:48 GMT Organization: AT&T Broadband Date: Fri, 31 Jan 2003 18:40:48 GMT Xref: archiver1.google.com comp.lang.ada:33655 Date: 2003-01-31T18:40:48+00:00 List-Id: > Also, I've my doubts about streams, because in the past I've tried them > to write files and in Gnat I couldn't manage to output exact sized types > except uncheckedconverting Streams can be quite convenient, but they are like programming without rep clauses. If the representation doesn't matter, fine. If it does, you have to write your own 'read/'write routines to and from Stream_Element_Array. But you probably want your IO to be in terms of objects at a higher level than Integer or Boolean, etc, so you would want to write your own Some_Record 'Write routines anyway. At the low level, your code will contain things like type Some_Record is record ... subtype External_Form_Some_Record is Ada.Streams.Stream_Element_Array(1 .. 6); function External_Some_Record is new Ada.Unchecked_Conversion (Source=>Some_Record, Target=>External_Form_Some_Record); but at higher levels writing a complex object just becomes a series of calls to 'Write on lower level subrecords, and, if there's nothing fancy going on, you can let the compiler create the series of subrecord 'Writes.