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,3ae40b42b99b8123 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news4.google.com!feeder3.cambriumusenet.nl!feed.tweaknews.nl!193.201.147.84.MISMATCH!xlned.com!feeder1.xlned.com!news.netcologne.de!newsfeed-fusi2.netcologne.de!newsfeed.straub-nv.de!nuzba.szn.dk!news.jacob-sparre.dk!pnx.dk!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Little tutorial about streams Date: Mon, 28 Feb 2011 21:48:19 -0600 Organization: Jacob Sparre Andersen Research & Innovation Message-ID: References: NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: munin.nbi.dk 1298951301 8123 69.95.181.76 (1 Mar 2011 03:48:21 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Tue, 1 Mar 2011 03:48:21 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5931 X-RFC2646: Format=Flowed; Original Xref: g2news2.google.com comp.lang.ada:18629 Date: 2011-02-28T21:48:19-06:00 List-Id: "mockturtle" wrote in message news:f8e7ccbf-a966-4568-9f0d-8e9e38f37dc6@glegroupsg2000goo.googlegroups.com... >Dear.all, >remembering my initial difficulties with streams (I self-taught Ada, using >few tutorials and lots of experiments before >landing to the RM), I decided >to write a page (my first one, so be patient :-) of the Wikibook with a >little stream >tutorial > >http://en.wikibooks.org/w/index.php?title=Ada_Programming/Input_Output/Stream_Tutorial Looks generally good. The little table under "Serialization functions" seems confusing, since it uses "composite" for Input and Output. But of course you can use Read and Write for "composite" types. It seems the intent is to be more informal (since "simple" is used rather than "elementary", which is good as there are no elementary class-wide types); may I suggest that the other entries use "complex" rather than "composite"? (Or some word meaning the same, if the confusion with "complex" numbers is a concern.) In the text under "Write attribute", we have: Clearly, the default implementation, being dependent on the machine and compiler, can be useful only if the data is written and read by programs compiled with the same compiler. If the data, for example, is to be sent across the network and read by a program written in another language, running on an unknown architecture, it is important for the programmer to control the format of the data sent over the wire. Because of this exigence, Ada allows the programmer to override S'Write (and the other stream-related functions described in the following), using an attribute definition clause (RM 13.3): I had to get a dictionary to figure out what the word "exigence" means. Probably best to use a simpler word here; no need to make a tutorial harder to read than needed. I'd probably use "requirement" or "need" instead. (I didn't edit this as I think it is important for the author to consider their intention; I may have missed it altogether.) It might make sense to mention that you can also specify these subprograms with an aspect clause in Ada 2012 (and indeed this will be preferred for most uses to the older attribute definition clause). But perhaps that's out of bounds here. Finally, there might be some value to mentioning the use of Generic_Dispatching_Constructor to build user-defined class-wide Input routines. But maybe that is too advanced of a topic?? Randy.