|
| From: | cph |
| Subject: | Re: using open-i/o-file function |
| Date: | Sat, 3 Apr 2021 18:18:14 -0700 |
I'm using MIT Scheme 10.1.5 and am curious why the following code usingopen-i/o-fileis not working as I expected. Does anyone know what the issue is?(define l "~/tmp0") (define x ''(a b (c d) e f)) (let ((p (open-i/o-file l))) (begin (write x p) (flush-output p) (let ((r (read p))) (close-port p) r))) ;Value: #!eofwhen I was expecting:;Value: (quote (a b (c d) e f))When usingopen-input-fileoropen-output-filethe results are expected:(let ((p (open-output-file l)))(write x p)(close-port p)) (let ((p (open-input-file l))) (let ((r (read p))) (close-port p) r)) ;Value: (quote (a b (c d) e f))
| [Prev in Thread] | Current Thread | [Next in Thread] |