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,e61c8636ef35379d X-Google-Attributes: gid103376,public From: "Marc A. Criley" Subject: Ada Streams usage (was Escape Sequences in Strings) Date: 2000/11/16 Message-ID: <3A13D59E.63A6F92@earthlink.net>#1/1 X-Deja-AN: 694319457 Content-Transfer-Encoding: 7bit References: <3A17B0E2@MailAndNews.com> <3A129A89.1B69E2FE@acm.org> X-Accept-Language: en Content-Type: text/plain; charset=us-ascii X-Complaints-To: abuse@earthlink.net X-Trace: newsread2.prod.itd.earthlink.net 974382147 63.178.185.66 (Thu, 16 Nov 2000 05:42:27 PST) Organization: Quadrus Corporation MIME-Version: 1.0 NNTP-Posting-Date: Thu, 16 Nov 2000 05:42:27 PST Newsgroups: comp.lang.ada Date: 2000-11-16T00:00:00+00:00 List-Id: Marin David Condic wrote: > > Jean Cohen wrote: > > > (by the way, I like the concept of streams in C++.) > > > > Ada has streams and stream I/O as well. It works pretty well and I think if > you get familiar enough with Ada to understand "The Ada Way" of doing it, > you'll find it to be a handy feature. Streams were an excellent addition to the Ada 95 standard and have proven to be very useful and flexible. Not only does one get all the benefits of a stream-based approach, but by extending the Root_Stream_Type via inheritance and implementing one's own Read() and Write() subprograms, one can employ stream-based communication via any available communication medium, not just files. I've done this for sockets, and so now I can output to a socket by doing something along the lines of: Type_Name'Write(Socket_Stream, Item); with a corresponding 'Read on the other end. Naturally 'Output and 'Input are also available and have been used. And of course I can change the transport mechanism if necessary by modifying the extension of Root_Stream_Type. ("Socket_Stream" was used for illustrative purposes, you don't necessarily want to include an indication of the internals of an activity within its name.) A number of cool additions were made to Ada 95, things like Streams and the Distributed Systems Annex, that I have found are so straightforward to use that it's not unusual to have small, experimental prototypes working the first time they're run. Marc A. Criley Senior Staff Engineer Quadrus Corporation