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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,c689b55786a9f2bd X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news4.google.com!feeder.news-service.com!newsfeed.straub-nv.de!noris.net!newsfeed.arcor.de!newsspool2.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: for S'Image use Func?? Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.15.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <4be417b4$0$6992$9b4e6d93@newsspool4.arcor-online.net> <1qcb6z4i20dyb.1dz2hd4c0vx69.dlg@40tude.net> <87632vwikr.fsf@ludovic-brenta.org> Date: Tue, 11 May 2010 10:35:24 +0200 Message-ID: <112n6z3554srr$.tjzjtg467xfo.dlg@40tude.net> NNTP-Posting-Date: 11 May 2010 10:35:24 CEST NNTP-Posting-Host: 2f6eb17e.newsspool1.arcor-online.net X-Trace: DXC=<4Z^j^P7Fb2_A0jCfgHO6>ic==]BZ:af>4Fo<]lROoR1<`=YMgDjhg2E>BTRb^`4f;[6LHn;2LCV>7enW;^6ZC`4IXm65S@:3>?2hZiH3j0c5: X-Complaints-To: usenet-abuse@arcor.de Xref: g2news2.google.com comp.lang.ada:11487 Date: 2010-05-11T10:35:24+02:00 List-Id: On Mon, 10 May 2010 23:30:28 +0200, Ludovic Brenta wrote: > Maciej Sobczak writes: >> Coming back to I/O - what I miss in Ada is the equivalent of fread in >> C - that is, an operation that reads *up to* the given number of >> bytes. Or maybe there is something that I didn't notice? Such an >> operation is an important basis for custom buffered input. It is a basis for creating inefficient time and space consuming programs. But we had this discussion before. >> Without it >> the only way to reinvent a proper I/O is via direct bindings to >> system- level API. > > Ada.Streams.Read (ARM 13.13.1(5)) does just that. > So does Ada.Text_IO.Get_Line (ARM A.10.1(49)). I would like to add that "read a byte" is a property of a stream. Not all files ("everything") are streams. Stream is an interface to an object, which can be supported by the object or not. But if I have an object like text buffer, I want an interface of a text buffer, rather than of a stream. If the object is a data base, I want to stream it even less. The bottom line is, Ada does it right (tm). -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de