[plt-scheme] no #!eof

From: Eli Barzilay (eli at barzilay.org)
Date: Tue Apr 15 01:06:37 EDT 2008

On Apr 15, Abdulaziz Ghuloum wrote:
> 
> On Apr 15, 2008, at 12:18 AM, Andrew Reilly wrote:
> >> E.g.,
> >>> (let ([p (open-string-input-port "12 #!eof 13")])
> >>     (list (read p) (read p) (read p)))
> >> (12 #!eof 13) ;;; in some unspecified order
> >
> > Ew! Yuck!  If you do that, then in what sense is it a marker of
> > the end of the file?  And if it isn't the marker of the end of the
> > file, what use is it at all?

+3, and I strongly agree with Matthew -- this is just asking for
problems.


> Have you never seen an eof midstream?  Well, I haven't invented the  
> concept. :-)
> Watch:
> 
> Welcome to MzScheme v3.99.0.18 [3m], Copyright (c) 2004-2008 PLT  
> Scheme Inc.
>  > (list (read) (read) (read) (read))
> ^D
> 12
> ^D
> 13
> (#<eof> 12 #<eof> 13)

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.

-- 
          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                  http://www.barzilay.org/                 Maze is Life!


Posted on the users mailing list.