[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#12216: peek-char incorrectly *CONSUMES* eof
From: |
Andy Wingo |
Subject: |
bug#12216: peek-char incorrectly *CONSUMES* eof |
Date: |
Thu, 07 Mar 2013 22:32:38 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.2 (gnu/linux) |
On Tue 05 Mar 2013 20:17, "David A. Wheeler" <address@hidden> writes:
> I reported:
>> > Guile's peek-char has a bug; it incorrectly *consumes* eof instead of
>> > just reporting it.
>
> Andy Wingo replied:
>> I have the feeling that for interactive use, if you expect to read a EOF
>> from a port and then continue, you have to not use peek-char. You need
>> to handle your own lookahead buffer. I know it's not a great answer,
>> but I can't think of anything else that makes sense.
>
> We don't want to read an EOF and then continue.
> We peek-char to not *CONSUME* an interactive EOF.
I understand what it is you want. But I don't know of any sane way to
implement it.
Given that it is an edge case -- peek-char on an interactive port -- I
think the thing to do is to document this inconsistency, and for you (in
your code) to implement some sort of abstraction that does not use
peek-char.
That is to say, use read-char, and do unread-char as necessary. Or keep
your own buffer around.
I know it isn't nice, but I don't know how to do anything better.
Andy
--
http://wingolog.org/
- bug#12216: peek-char incorrectly *CONSUMES* eof, Andy Wingo, 2013/03/05
- bug#12216: peek-char incorrectly *CONSUMES* eof, David A. Wheeler, 2013/03/05
- bug#12216: peek-char incorrectly *CONSUMES* eof,
Andy Wingo <=
- bug#12216: peek-char incorrectly *CONSUMES* eof, Daniel Hartwig, 2013/03/08
- bug#12216: peek-char incorrectly *CONSUMES* eof, David A. Wheeler, 2013/03/09
- bug#12216: peek-char incorrectly *CONSUMES* eof, Daniel Hartwig, 2013/03/09
- bug#12216: peek-char incorrectly *CONSUMES* eof, Andy Wingo, 2013/03/13
- bug#12216: peek-char incorrectly *CONSUMES* eof, David A. Wheeler, 2013/03/13
- bug#12216: peek-char incorrectly *CONSUMES* eof, Andy Wingo, 2013/03/13
- bug#12216: peek-char incorrectly *CONSUMES* eof, Mark H Weaver, 2013/03/13
- bug#12216: peek-char incorrectly *CONSUMES* eof, Andy Wingo, 2013/03/13
- bug#12216: peek-char incorrectly *CONSUMES* eof, Mark H Weaver, 2013/03/14
- bug#12216: peek-char incorrectly *CONSUMES* eof, David A. Wheeler, 2013/03/14