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,cbb87dd49168c396 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-10-31 06:11:37 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!colt.net!newspeer.clara.net!news.clara.net!server3.netnews.ja.net!newshost.central.susx.ac.uk!news.bton.ac.uk!not-for-mail From: John English Newsgroups: comp.lang.ada Subject: Re: Get_Line Date: Thu, 31 Oct 2002 13:10:51 +0000 Organization: University of Brighton Message-ID: <3DC12BDB.30DF4656@brighton.ac.uk> References: <3DBF3659.30709@acm.org> <4dRv9.46453$wm6.7691@nwrddc01.gnilink.net> <3DC0204E.4050203@acm.org> <3DC106C7.4AE0AF9B@brighton.ac.uk> NNTP-Posting-Host: straumli.it.bton.ac.uk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: saturn.bton.ac.uk 1036069810 11639 193.62.183.204 (31 Oct 2002 13:10:10 GMT) X-Complaints-To: news@bton.ac.uk NNTP-Posting-Date: 31 Oct 2002 13:10:10 GMT X-Mailer: Mozilla 4.79 [en] (Windows NT 5.0; U) X-Accept-Language: en Xref: archiver1.google.com comp.lang.ada:30256 Date: 2002-10-31T13:10:10+00:00 List-Id: Preben Randhol wrote: > > John English wrote: > > Robert A Duff wrote: > >> > >> Whether or not you like my Get_Line idea, surely you must admit that > >> beginners and experts are troubled by the current Text_IO interface. > > > > IMHO, the big problem with Text_IO is the line-oriented nature of the > > library (a la Pascal). C-style character-oriented I/O is so much easier > > to deal with! > > Why? Example: copying a text file involves either processing characters and calling End_Of_Line to know when to call New_Line, or using Get_Line and checking received buffer sizes to know when to call New_Line. You can't just stream characters without regard to line breaks. It's also hard to deal with multi-line strings. In C, these just have embedded '\n' characters. In Ada, you can't just use '\n' (or ASCII.LF) because although it'll work on Unix systems, you have to use ASCII.CR on Macs and ASCII.CR & ASCII.LF on Windows (whereas C libraries will translate to/from '\n' automatically). So you can't just treat a line break as just another character in a portable way. ----------------------------------------------------------------- John English | mailto:je@brighton.ac.uk Senior Lecturer | http://www.it.bton.ac.uk/staff/je Dept. of Computing | ** NON-PROFIT CD FOR CS STUDENTS ** University of Brighton | -- see http://burks.bton.ac.uk -----------------------------------------------------------------