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,f6f130eea077b8f8 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-05-21 09:23:02 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!arclight.uoregon.edu!wn13feed!wn12feed!wn14feed!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: 'Write attribute vs Write procedure. References: <7vk7ck7iwc.fsf@vlinux.voxelvision.no> X-Newsreader: Tom's custom newsreader Message-ID: NNTP-Posting-Host: 12.234.13.56 X-Complaints-To: abuse@attbi.com X-Trace: sccrnsc03 1053534136 12.234.13.56 (Wed, 21 May 2003 16:22:16 GMT) NNTP-Posting-Date: Wed, 21 May 2003 16:22:16 GMT Organization: AT&T Broadband Date: Wed, 21 May 2003 16:22:55 GMT Xref: archiver1.google.com comp.lang.ada:37591 Date: 2003-05-21T16:22:55+00:00 List-Id: >> Personally, I think using the default 'write is only reasonable >> in the very simplest cases. If something is big, or complicated, >> I'd write my own 'write for it. > >Yes, but that removes much of the attraction of using a stream in the >first place. It should only be necessary to do your own write if you >wanted another representation of it in the external format. A prime >example of rendering a very nice feature of the language pretty much >unusable because of a poor implementation. I disagree. It is convenient when you use it that you needn't distinguish between a 'write that will write in a canonical, vs a special external format. In the OP's case, it was probably simpler to get the program up and running with the standard 'write, rather than having to make his own, and then worry about doing something special as a matter of performance tuning. You also still have use at a higher level, eg type Sound_Bytes is record Time : Ada.Calendar.Time; Audio : Wave; Title : String(1 .. 10); end record; If you have a special Wave'write, you can say Sound_Bytes'write and it will do the standard thing for Time and Name but call your special routine for Audio, so you probably don't need to make your own Sound_Bytes'write. At it's own abstraction level, Sound_Bytes is neither big nor complicated, so you probably don't need a special 'write.