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.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM 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!postnews.google.com!j35g2000yqm.googlegroups.com!not-for-mail From: Maciej Sobczak Newsgroups: comp.lang.ada Subject: Re: for S'Image use Func?? Date: Wed, 12 May 2010 15:14:59 -0700 (PDT) Organization: http://groups.google.com Message-ID: <1fe63c27-207f-4a73-a823-3ec1410e35e8@j35g2000yqm.googlegroups.com> References: <4be417b4$0$6992$9b4e6d93@newsspool4.arcor-online.net> <1qcb6z4i20dyb.1dz2hd4c0vx69.dlg@40tude.net> <87632vwikr.fsf@ludovic-brenta.org> <112n6z3554srr$.tjzjtg467xfo.dlg@40tude.net> <1fv8frriu1h4s.g9jy78q1c0io.dlg@40tude.net> <7a31eab7-1a1c-4653-bf49-ff1498e318f9@b18g2000yqb.googlegroups.com> <199e07cb-2e93-40fc-974d-000b83b6000f@s29g2000yqd.googlegroups.com> <16vlvmzpbalm5.1chuumyyuyb2j$.dlg@40tude.net> NNTP-Posting-Host: 83.76.75.161 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: posting.google.com 1273702499 10879 127.0.0.1 (12 May 2010 22:14:59 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Wed, 12 May 2010 22:14:59 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: j35g2000yqm.googlegroups.com; posting-host=83.76.75.161; posting-account=bMuEOQoAAACUUr_ghL3RBIi5neBZ5w_S User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3,gzip(gfe) Xref: g2news2.google.com comp.lang.ada:11571 Date: 2010-05-12T15:14:59-07:00 List-Id: On 12 Maj, 17:58, "Dmitry A. Kazakov" wrote: > >> Why an Ada program handling texts need to be aware of your system? > > > Because it is running on my system. It's a pretty good idea to have > > some local awareness. > > No, that makes the program non-portable and fragile against system > modifications. As I already said, I'm OK with this kind of non-portability. It does not bother me that my program will not work on non-existing systems (which effectively includes those obscure systems that you can surely refer to for the sake of example, but that none of us will ever use anyway). I am pragmatic here. > > Even assuming that I can open some file, the whole "abstraction of a > > text" is severely limited. I cannot, for example, read the second > > paragraph of the third chapter of the book that is in the file. > > It is necessarily limited here because not every text is a book. Bingo. So what is a text, really? Ada.Text_IO (similarly to text I/O libraries in other languages) focuses on lines. This is similarly outdated as focusing on columns and really belongs to the same era. When I read the text in my web browser (the most frequently used application for text consumption nowadays), the "lines" are whatever the browser cares to display, which depends on how I scale the window and what font size I select. I can change these properties dynamically and in particular nothing prevents me from opening the same document in several windows, each differently scaled. This means that "lines" is not a property of the data source, it is a property of the display. Yet everybody is dead focused on the concept of text files that are composed of lines. There are no lines, really. If "text" means anything more than a stream on steroids, then it must be recognized to have a much richer structure than just a sequence of lines. Paragraphs, headings, chapters, whatever - these are structural elements of text. But not lines. Lines and columns are artifacts of the teletype printers era - gone long ago. With this in mind, the "text abstraction" as represented by Ada.Text_IO is really a stream on steroids. That's why I don't understand why you put so much stress on distinguish the "text" from the "stream", while the effective distance between them is close to zero. (please don't remind me constantly about filesystems that are based on records - the line-oriented records are long gone with teletype printers and nowadays "filesystems" will store whole files in single records instead, so we are back to streams anyway) > >> The problem of Text_IO is columns. > > > Not only. It cannot detect the end of stream without blocking, for > > example. > > That is a property of the stream. Don't use streams as texts. Translation: Text_IO cannot detect the end of text without blocking. -- Maciej Sobczak * http://www.inspirel.com YAMI4 - Messaging Solution for Distributed Systems http://www.inspirel.com/yami4