[plt-scheme] no #!eof

From: Abdulaziz Ghuloum (aghuloum at cs.indiana.edu)
Date: Tue Apr 15 01:30:06 EDT 2008

On Apr 15, 2008, at 1:06 AM, Eli Barzilay wrote:

> What about:
>> (read)
>   (
>   1
>   ^D
>   2
>   )
> At least in the old version of Chez I get
>   Error in read: unexpected end-of-file.
> right after the ^D, but I get (1 #!eof 2) if I use `#!eof' instead of
> ^D.

Right.  This is because, as Matthew said, "a reader can treat an eof  
in the character stream as different from a representation of a  
literal eof."  Read returns an eof if the first thing it sees is a  
^D, but signals an error if it sees a ^D while trying to parse a  
datum (e.g., if you try to read from the string "(", you get an error  
since there is a "character stream" eof after the left parenthesis).   
Read doesn't signal an error for the eof objects it constructs itself  
since there is no "character stream" eof in #!eof.

> this is just asking for problems.

I didn't mean to create trouble.  Sorry.


Posted on the users mailing list.