Folks
I plan
to push out a new draft H98 report this week. Here is one
suggested
clarification from Sigbjorn, arising from recent uncertainty about the
true
meaning of getLine.
I'll
incorporate it unless anyone yells.
Simon
-----Original Message-----
From: Simon Marlow
Sent: 05 June 2002 10:27
To: Sigbjorn Finne; Simon Peyton-Jones
Subject: RE: cvs commit: hugs98/lib IO.hs Prelude.hs
From: Simon Marlow
Sent: 05 June 2002 10:27
To: Sigbjorn Finne; Simon Peyton-Jones
Subject: RE: cvs commit: hugs98/lib IO.hs Prelude.hs
Agree with everything Sigbjorn says below. Also: change the
definition of getLine (section A.3) to be
getLine = hGetLine stdin
Cheers,
Simon
-----Original Message-----
From: Sigbjorn Finne [mailto:[EMAIL PROTECTED]]
Sent: 04 June 2002 16:17
To: Simon Peyton-Jones
Cc: Simon Marlow
Subject: Re: cvs commit: hugs98/lib IO.hs Prelude.hsHow about the following:* change the Report (7.1) to say something along the lines of:getChar raises an exception (Section 7.3) on end-of-file; apredicate isEOFError that identifies this exception is definedin the IO library. getLine raises an end-of-file exceptionunder the same conditions as hGetLine in the IO library.* in the Library Report, say when hGetLine raises an exception:Computation hGetLine hdl reads a line from the file orchannel managed by hdl. The Prelude's getLine is a shorthandfor hGetLine stdin.Error reporting: the hWaitForInput, hReady and hGetCharcomputations may fail with: isEOFError if the end of file hasbeen reached.hGetLine will also fail with isEOFError if end-of-file is encounteredwhen reading the first character of the line. If hGetLine encountersend-of-file at any other point while reading in a line, it is treated asa line terminator and the (partial) line is returned.Actually, I'd prefer if 11.7.1 only dealt with hWaitForInput and hReady(as they're the "checking for input" operations). A second section,named "Reading input", would then be concerned with hGetChar andhGetLine.--sigbjorn----- Original Message -----From: "Simon Peyton-Jones" <[EMAIL PROTECTED]>To: "Sigbjorn Finne" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>Sent: Tuesday, June 04, 2002 04:03Subject: RE: cvs commit: hugs98/lib IO.hs Prelude.hs> Should I change the Report wording to be clearer?
>
> Simon
>
> | -----Original Message-----
> | From: Sigbjorn Finne [mailto:[EMAIL PROTECTED]]
> | Sent: 03 June 2002 15:49
> | To: [EMAIL PROTECTED]
> | Subject: cvs commit: hugs98/lib IO.hs Prelude.hs
> |
> |
> | sof 2002/06/03 07:49:12 PDT
> |
> | Modified files:
> | lib IO.hs Prelude.hs
> | Log:
> | Interpret Report wording for Prelude.getLine and IO.hGetLine
> | to mean the Right Thing. If EOF is encountered for a partial
> | line (>= 1 chars), interpret this as '\n'.
> |
> | Revision Changes Path
> | 1.4 +25 -8 hugs98/lib/IO.hs
> | 1.25 +23 -5 hugs98/lib/Prelude.hs
> | _______________________________________________
> | Cvs-hugs mailing list
> | [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/cvs-hugs
> |