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-Thread: 103376,90b27c91e19c3731 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news4.google.com!news.glorb.com!solaris.cc.vt.edu!news.vt.edu!newsfeed-00.mathworks.com!nntp.TheWorld.com!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: I/O streaming with custom data transport Date: Wed, 22 Nov 2006 08:50:07 -0500 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: <4sgsgoFvn3caU1@mid.individual.net> NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: pcls4.std.com 1164203407 24748 192.74.137.71 (22 Nov 2006 13:50:07 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Wed, 22 Nov 2006 13:50:07 +0000 (UTC) User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.3 (irix) Cancel-Lock: sha1:BMzNIDaUUbgWaiUelXMMiT/akT8= Xref: g2news2.google.com comp.lang.ada:7639 Date: 2006-11-22T08:50:07-05:00 List-Id: Maciej Sobczak writes: > procedure Write_Hello(Stream : in out Stream_Access) is > begin > String'Write(Stream, "Hello"); > end Write_Hello; I don't understand this. Ada streams are streams of Stream_Elements (usually bytes), and the 'Read/'Write attributes encode things in some way that is not necessarily human-readable. For example, I think the above outputs the bounds of the string in some binary form. But the original question was about streams of characters, intended to be human-readable. Right? So how do Ada's streams help, here? It seems to me what you want is an abstract Character_Output_Stream type, with a primitive (or class-wide?) operation that puts a Character to the stream. Then you can make derived types for sending to a file, to an in-memory buffer, etc. - Bob