Re: unread more than one char
- From: Edi Weitz <spamtrap@xxxxxxxxxx>
- Date: Mon, 08 Oct 2007 22:43:42 +0200
On Mon, 08 Oct 2007 16:38:08 -0400, Alberto Riva <ariva@xxxxxxxxxxxxxx> wrote:
What about:
(defun stream-backup (stream n)
(file-position stream
(- (file-position stream) n)))
The standard doesn't require streams to be able to represent the
notion of file position, i.e. what FILE-POSITION returns could be NIL,
or trying to change the file position doesn't have to succeed.
Also it says (in the FILE-POSITION dictionary entry) that for "a
character file, performing a single READ-CHAR or WRITE-CHAR operation
may cause the file position to be increased by more than 1."
Edi.
--
Lisp is not dead, it just smells funny.
Real email: (replace (subseq "spamtrap@xxxxxxxxxx" 5) "edi")
.
- Follow-Ups:
- Re: unread more than one char
- From: Alberto Riva
- Re: unread more than one char
- References:
- unread more than one char
- From: amolaggarwal@xxxxxxxxx
- Re: unread more than one char
- From: Alberto Riva
- unread more than one char
- Prev by Date: Re: unread more than one char
- Next by Date: Re: Collect from a recursion
- Previous by thread: Re: unread more than one char
- Next by thread: Re: unread more than one char
- Index(es):
Relevant Pages
|