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=0.6 required=5.0 tests=BAYES_00,TO_NO_BRKTS_FROM_MSSP autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,bc1361a952ec75ca X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-08-10 06:35:50 PST Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!feed.textport.net!newsranger.com!www.newsranger.com!not-for-mail Newsgroups: comp.lang.ada From: Ted Dennison References: <3b690498.1111845720@news.worldonline.nl> <9kbu15$9bj@augusta.math.psu.edu> <9kbvsr$a02@augusta.math.psu.edu> <3B69DB35.4412459E@home.com> <3B6F312F.DA4E178E@home.com> <23lok9.ioi.ln@10.0.0.2> <3B70AB15.35845A98@home.com> <3B70C665.BBC5F000@home.com> <3B721BC3.76A2161C@home.com> <3B732365.81CFD607@home.com> Subject: Data portability with streams Message-ID: X-Abuse-Info: When contacting newsranger.com regarding abuse please X-Abuse-Info: forward the entire news article including headers or X-Abuse-Info: else we will not be able to process your request X-Complaints-To: abuse@newsranger.com NNTP-Posting-Date: Fri, 10 Aug 2001 09:35:38 EDT Organization: http://www.newsranger.com Date: Fri, 10 Aug 2001 13:35:38 GMT Xref: archiver1.google.com comp.lang.ada:11756 Date: 2001-08-10T13:35:38+00:00 List-Id: In article <3B732365.81CFD607@home.com>, Warren W. Gay VE3WWG says... > >Ted Dennison wrote: >> >Ada's approach is different (for streams). Rather than create a whole >> >new stream class, you simply customize the data type formats for the >> >data types themselves. When they are put to the stream, your routines >> >are called for the I/O for those data types, instead of the default >> >ones. >> >> However, you can also create a whole new stream class, if you really want to. > >depending upon what you mean by "whole new stream class", I don't >think it would help in the Ada context. If you derived a new stream, I was just being flip. You are quite correct that a stream reimplementation alone wouldn't do anything for this particular problem. However, implementing custom stream I/O attributes for everything is not an enviable task, and may make those types a pain to use for other streams (I think I went into this a bit in another post about ASN.1). You can sort of think of the stream I/O attributes as the way of changing data representation, and the streams themselves as the way of representing a data-neutral medium. So if you want to represent encrypted data, a buffer, or a disk file, you'd use a stream. If you want to represent ASN.1 or XDR, you are talking about custom stream I/O attributes. (If you want a circular buffer that drops old data only on record boundries, you've got something in between, but that's a whole topic unto itself...) I think one possible way to do this without causing a ton of work would be to create a "translation generic" for each target (ASN.1 or XDR) type. Hmmm. That might be worth experimenting with one day... --- T.E.D. homepage - http://www.telepath.com/dennison/Ted/TED.html home email - mailto:dennison@telepath.com