[plt-scheme] why does input port close?

From: Eli Barzilay (eli at barzilay.org)
Date: Tue Nov 19 13:19:50 EST 2002

On Nov 19, David B. Tucker wrote:
> (define b (call-with-input-file "/home/dbtucker/A.hs" input-port->line-stream))
> (b)
> The call to (a) succeeds, but the call to (b) gives this error:
>   read-char: input port is closed

Just look at the documentation for it -- "If proc returns, then the
port is closed automatically and the value(s) yielded by the proc
is(are) returned".

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

Posted on the users mailing list.