[plt-scheme] no #!eof
Andrew Reilly wrote:
> On Tue, Apr 15, 2008 at 12:55:40AM -0400, Abdulaziz Ghuloum wrote:
>> On Apr 15, 2008, at 12:18 AM, Andrew Reilly wrote:
>> Have you never seen an eof midstream?
>
> Honestly, no. If it's in the middle, it clearly can't be at the end.
Puzzle: What is the expected output of the following?
#!scheme
(define file "/tmp/tmp.txt")
(thread
(lambda ()
(with-output-to-file file
(lambda ()
(let loop ()
(sleep 2)
(write "foo\n")
(loop)))
#:exists 'replace)))
(sleep 0.5)
(with-input-from-file file
(lambda ()
(let loop ()
(display (read-line))
(newline)
(sleep 1)
(loop))))
--
Jens Axel Søgaard