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!news3.google.com!feeder1.cambriumusenet.nl!feed.tweaknews.nl!193.201.147.71.MISMATCH!xlned.com!feeder3.xlned.com!news.astraweb.com!border3.a.newsrouter.astraweb.com!news.netcologne.de!ramfeed1.netcologne.de!newsfeed.arcor.de!newsspool4.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> <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> <1fe63c27-207f-4a73-a823-3ec1410e35e8@j35g2000yqm.googlegroups.com> Date: Thu, 13 May 2010 09:31:25 +0200 Message-ID: <1g82ubkc0t0pf$.nuj3gqp1buh6.dlg@40tude.net> NNTP-Posting-Date: 13 May 2010 09:31:21 CEST NNTP-Posting-Host: 3f70c3e0.newsspool1.arcor-online.net X-Trace: DXC=` On Wed, 12 May 2010 15:14:59 -0700 (PDT), Maciej Sobczak wrote: > 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. I am too. I know that Windows does exist and that LF /= CR LF. See: http://en.wikipedia.org/wiki/CR/LF Al this mess is abstracted away by Ada.Text_IO. (And OpenVMS exists too) >>> 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? It is not a book. > 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. Browser renders texts. It means that text is not the input, but the output of. The input of a browser is a program written in some ugly language named HTML. > This means that "lines" is not a property of the data source, it is a > property of the display. I consider text an ordered set of lines. > Yet everybody is dead focused on the concept of text files that are > composed of lines. There are no lines, really. Of course there are, see //-comments in C++. > 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. That was exactly the mistake Ada designers made with Text_IO. They tried to add more there, pagination etc. They should have stay with lines. (In software design this type of error is called "fat class") > 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. Because I used to write compilers and serial communication protocols. >>> 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. No, the translation is: stream does not have an end. You cannot detect something that does not exist. Text has an end. Ergo, if you wanted a text on the stream, you would need an encoding layer. (This layer exists and is customarily broken in UNIX and Windows.) -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de