[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
What should CLOSE return? Closed-channel-object, or truefilename.
- To: common-lisp@SU-AI.ARPA
- Subject: What should CLOSE return? Closed-channel-object, or truefilename.
- From: Robert Elton Maas <REM@IMSSS.SU.EDU>
- Date: 1985 March 19 22:10:06 PST (=GMT-8hr)
- Cc: Gall@MIT-MULTICS.ARPA
- Reply-to: REM@MIT-MC.ARPA
- Sender: REM%IMSSS@SU-SCORE.ARPA (for undeliverable-mail notifications)
- Sent: to SU-AI.ARPA by IMSSS.? via ETHERNET with PUPFTP; 1985-Mar-19 22:24:42 PST (=GMT-8hr)
> !section 21.3(7) Nick Gall 85-03-19
> !version Digital Press 1984
> !topic What does CLOSE Return?
> I think it should return the STREAM it was given to close. This
> would make it symmetric with OPEN: OPEN returns an open stream,
> CLOSE returns a closed stream.
That's not symmetric, that's coercive. OPEN and CLOSE are like
matching parenthesis, one does it and the other undos it except for
a residual side-effect. OPEN takes a name and returns an I/O channel
(at the LISP level, an object that can be name an active stream of
data). CLOSE takes an I/O channel and should return a name to be
symmetric with OPEN. This would be an opportune time to solve race
conditions where several users are making different versions of the
same file at the same time by the trick of writing a temporary file
and then renaming it during the CLOSE. At CLOSE the version number is
determined, and at that moment before somebody can create a later
version the lisp CLOSE function obtains the true filename of the
particular version we created.