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:16:06 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!arclight.uoregon.edu!wn4feed!wn2feed!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: <3D80C1B1.5070703@telepath.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 1031858158 12.234.13.56 (Thu, 12 Sep 2002 19:15:58 GMT) NNTP-Posting-Date: Thu, 12 Sep 2002 19:15:58 GMT Organization: AT&T Broadband Date: Thu, 12 Sep 2002 19:15:59 GMT Xref: archiver1.google.com comp.lang.ada:28885 Date: 2002-09-12T19:15:59+00:00 List-Id: > Ada.Streams.Sockets.Connect > (New_Socket => Server, > Address => (127,0,0,1), > Port => 5517, > Protocol => Ada.Streams.Sockets.TCP); Claw, even the GMGPL version on adapower, has procedure Open(Socket : in out Socket_Type; Domain_Name: in String; Port : in Port_Type; Timeout : in Duration := 30.0); procedure Open(Socket : in out Socket_Type; Address : in Network_Address_Type; Port : in Port_Type; Timeout : in Duration := 30.0); > Server_Request'Write (Server, Request); > Server_Response'Read (Server, Response); I'm not quite sure how high level this is supposed to be. Claw has type Socket_Stream_Type(Socket : access Socket_Type'class) is new Ada.Streams.Root_Stream_Type with ... so you can write userid'write(stream_access, "tmoran"); and I'm currently working on f : ftp.stream_io.remote_file_type; stream : ftp.stream_io.stream_access; ... ftp.stream_io.connect(f,"upload.attbi.com",userid=>"joe",password=>"secret"); ftp.stream_io.create(f, ftp.stream_io.out_file, "test"); claw.bitmaps.root_dibitmap_type'class'output(stream,pic); > that 'Write on a 1000-byte array will, by default, perform one 'Write on > each component of that array, amounting to 1000 'Writes. That means > any time someone is interested in efficency, they end up having to make > their own 'Write that calls Ada.Streams.Write once for each object that > they want transferred efficiently. This is an issue for *any* stream, > not just the one I'm proposing above. Agreed. Anytime you make a data structure that needs to be read/written, part of the job is to write the Data_Structure'Write etc. routines. So it would be nice to have an efficient String'Write, but I'm not sure how much real work it would let you avoid.