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,68b43b837fb71f2a X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-09-12 12:15:59 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!canoe.uoregon.edu!arclight.uoregon.edu!newsfeed.mathworks.com!wn3feed!worldnet.att.net!204.127.198.204!attbi_feed4!attbi.com!sccrnsc01.POSTED!not-for-mail From: tmoran@acm.org Newsgroups: comp.lang.ada Subject: Re: Thoughts on the recent ICFP contest References: <3D80A356.93042472@despammed.com> X-Newsreader: Tom's custom newsreader Message-ID: NNTP-Posting-Host: 12.234.13.56 X-Complaints-To: abuse@attbi.com X-Trace: sccrnsc01 1031858159 12.234.13.56 (Thu, 12 Sep 2002 19:15:59 GMT) NNTP-Posting-Date: Thu, 12 Sep 2002 19:15:59 GMT Organization: AT&T Broadband Date: Thu, 12 Sep 2002 19:15:59 GMT Xref: archiver1.google.com comp.lang.ada:28884 Date: 2002-09-12T19:15:59+00:00 List-Id: > I thought that 'Write recursively used > all the component 'Writes to pack the > object into a stream, and then the > possibly dispatching operations of the > stream would determine the method of > transmission. Yes 'Write is called recursively, but all it does is make a bunch of calls to routines taking an access to stream and the particular item. Commonly those routines write the value to successive positions in a stream_element_array or to an IO device, but they don't have to. Ultimately you get a bunch of calls to Write(your_child_of_Root_Stream_Type, Stream_Element_Array). If that routine merely adds one to a global counter, and quite ignores the Stream_Element_Array, then you have a "component counter", not an IO operation. Claw has a Marshalling thing type Buffer_Type(Initial_Length : Ada.Streams.Stream_Element_Count) is new Ada.Streams.Root_Stream_Type with private; and Claw.Sockets has, for instance, procedure Output(Socket : in out Datagram_Type; Item : in out Claw.Marshalling.Buffer_Type; Address : in Network_Address_Type := System_Supplied_Address; Port : in Port_Type := 0); specifically to let you do a bunch of short writes into a marshalling buffer, then do one socket write of that buffer.