comp.lang.ada
 help / color / mirror / Atom feed
From: John English <je@brighton.ac.uk>
Subject: Re: Get_Line
Date: Thu, 31 Oct 2002 13:10:51 +0000
Date: 2002-10-31T13:10:10+00:00	[thread overview]
Message-ID: <3DC12BDB.30DF4656@brighton.ac.uk> (raw)
In-Reply-To: slrnas253b.18n.randhol+news@kiuk0152.chembio.ntnu.no

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
-----------------------------------------------------------------



  reply	other threads:[~2002-10-31 13:10 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-10-29 20:24 Get_Line Justin Birtwell
2002-10-29 20:55 ` Get_Line David C. Hoos
2002-10-30  1:30 ` Get_Line Jeffrey Carter
2002-10-30 13:33   ` Get_Line Justin Birtwell
2002-10-30 14:40     ` Get_Line Preben Randhol
2002-10-30 17:09     ` Get_Line Jean-Pierre Rosen
2002-10-30 18:08     ` Get_Line Jeffrey Carter
2002-10-30 22:42       ` Get_Line Robert A Duff
2002-10-31  0:26         ` Get_Line Chad R. Meiners
2002-10-31  0:44           ` Get_Line Robert A Duff
2002-10-31 10:32             ` Get_Line John English
2002-10-31 11:30               ` Get_Line Preben Randhol
2002-10-31 13:10                 ` John English [this message]
2002-10-31 17:39             ` Get_Line Warren W. Gay VE3WWG
2002-10-31 21:46             ` Get_Line Chad R. Meiners
2002-11-01 16:59               ` Get_Line Robert A Duff
2002-11-01 21:04                 ` Get_Line Chad R. Meiners
2002-11-01 23:32                   ` Get_Line Matthew Heaney
2002-11-02  0:28                     ` Get_Line Chad R. Meiners
2002-10-31  8:53       ` Get_Line Preben Randhol
2002-10-31 18:04         ` Get_Line Jeffrey Carter
2002-11-01 11:18           ` Get_Line Preben Randhol
2002-10-30 14:44 ` Get_Line Preben Randhol
2002-10-31 21:55 ` Get_Line Matthew Heaney
  -- strict thread matches above, loose matches on Subject: below --
1999-07-02  0:00 GET LINE babefan
1999-07-02  0:00 ` czgrr
1998-06-05  0:00 get_line Steve Dyrdahl
1998-06-05  0:00 ` get_line Samuel Mize
1998-06-17  0:00   ` get_line Hans Marqvardsen
1998-06-18  0:00     ` get_line John McCabe
1998-06-21  0:00       ` get_line Robert Dewar
1998-06-06  0:00 ` get_line Dale Stanbrough
1998-06-06  0:00   ` get_line Matthew Heaney
1998-06-07  0:00     ` get_line Dale Stanbrough
1998-06-06  0:00       ` get_line Matthew Heaney
1998-06-18  0:00     ` get_line Robert I. Eachus
1998-06-06  0:00   ` get_line Robert Dewar
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox