Re: Strange behaviour of *standard-output* in sbcl
- From: Richard M Kreuter <kreuter@xxxxxxxxx>
- Date: Wed, 30 Jul 2008 17:39:30 GMT
Joshua Taylor <joshuaaaron@xxxxxxxxx> writes:
The Hyperspec says about WITH-OPEN-FILE, "with-open-file uses open
to create a file stream to file named by filespec. Filespec is the
name of the file to be opened. Options are used as keyword arguments
to open." From an issue write (about dynamic extent, not directly
relevant here), "[WITH-OPEN-FILE] probably should inherit whatever
restrictions are placed on WITH-OPEN-STREAM, so you can implement it
that way."
This suggests that WITH-OPEN-FILE could be implemented as
(defmacro with-open-file2 ((var filename &rest options) &body body)
`(with-open-stream (,var (open ,filename ,@options))
,@body))
Not necessarily. WITH-OPEN-FILE has an extra requirement:
| If a new output file is being written, and control leaves
| abnormally, the file is aborted and the file system is left, so far
| as possible, as if the file had never been opened.
I don't see anything in WITH-OPEN-STREAM to suggest that it's supposed
to do anything interesting in case of abnormal transfer out of the
body.
--
RmK
.
- Follow-Ups:
- Re: Strange behaviour of *standard-output* in sbcl
- From: Joshua Taylor
- Re: Strange behaviour of *standard-output* in sbcl
- References:
- Strange behaviour of *standard-output* in sbcl
- From: Haiwei
- Re: Strange behaviour of *standard-output* in sbcl
- From: Pascal J. Bourguignon
- Re: Strange behaviour of *standard-output* in sbcl
- From: Haiwei
- Re: Strange behaviour of *standard-output* in sbcl
- From: Joshua Taylor
- Strange behaviour of *standard-output* in sbcl
- Prev by Date: Re: Lisp Machine keyboard usage
- Next by Date: Re: Strange behaviour of *standard-output* in sbcl
- Previous by thread: Re: Strange behaviour of *standard-output* in sbcl
- Next by thread: Re: Strange behaviour of *standard-output* in sbcl
- Index(es):