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: 103376,5afe598156615c8b X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!t-online.de!keepthis.news.telefonica.de!telefonica.de!news.belwue.de!newsfeed.arcor.de!newsspool2.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: Get_Line problem (GNAT bug?) 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: <1c1gbc5u9cpvp.1wj1zhhn7q86j$.dlg@40tude.net> <1tua3ke1kfoog.1wqou5d9mwtly.dlg@40tude.net> Date: Fri, 8 Dec 2006 10:11:15 +0100 Message-ID: <18v5cbvzvfow6.1buy2642zkahr.dlg@40tude.net> NNTP-Posting-Date: 08 Dec 2006 10:09:35 CET NNTP-Posting-Host: 8c49af86.newsspool3.arcor-online.net X-Trace: DXC=`=X:`^jmk@<0 On Thu, 07 Dec 2006 17:50:50 -0500, Robert A Duff wrote: > "Dmitry A. Kazakov" writes: > >> No. It is the concept, which is broken. And that wasn't Ada, who broke it, >> but crippled operating systems like Windows and Unix. In a proper OS the >> line terminator is not a character. > > Why do you say so? The concept of "sequence of characters", which > includes blanks and end-of-line chars, seems pretty good to me. > (Other control chars, such as tabs, should be banished to the far > side of the moon.) The concept of a sequence of characters is OK, but it is not text I/O. It is just String. What I mean is that text I/O cannot be defined in such terms. If we did that, we would implicitly specify a certain encoding format, which is OS/presentation specific. It would be OK if there were only one OS and only one presentation format. But, to give an extreme example, a text in HTML format should be readable using Text_IO without seeing any
tags. > I think the Unix idea -- "line terminator (or separator?) = a particular > character" -- is a pretty convenient model. It's certainly convenient > for parsing input text: read one char at a time, and deal with it, > treating end-of-line as one possible case. E.g., an Ada compiler > typically works that way. I don't think so. From the compiler construction perspective this presentation format is very unfortunate, because you don't know in advance how long a source line is. (Ada program validity depends on line ends.) Further areas where this idea works quite poorly are networking (there is no native way to block packets), keyboard input. It is were all these buffer overrun issues are rooted. And in general it leads to nowhere. What about EOF character? What about "abs", "declare", "loop" etc characters? (:-)) > How much human intellectual effort has been wasted by having to deal > with "text mode" versus "binary mode" ftp?! The unix model makes them > identical, and if all operating systems had magically agreed on that > from the dawn of time, we'd all be better off. Absolutely, that is exactly my point. It is the flawed Unix model which considers texts, executables, databases and mouse buttons as sequences of characters. It is untyped. They should be different ADTs! (:-)) -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de