[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#12216: peek-char incorrectly *CONSUMES* eof

From: Mark H Weaver
Subject: bug#12216: peek-char incorrectly *CONSUMES* eof
Date: Thu, 14 Mar 2013 13:13:39 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)

Andy Wingo <address@hidden> writes:

> On Wed 13 Mar 2013 19:10, Mark H Weaver <address@hidden> writes:
>> I don't know, it might not be that bad, now that we've agreed on a way
>> to extend the port structure in 2.0.  Maybe we could just have a "last
>> peek-char returned EOF" flag that would be consulted by the other read
>> primitives.
>> I agree that we should not allow EOF to be unread.
>> What do you think?
> I really doubt our ability to get it right.  Consider that we have code
> that accesses the buffer directly, binary and textual ports, etc
> etc... I don't think we're going to get this right.

I think you're being overly pessimistic, but for the sake of argument,
suppose you're right.  Then we do the best we can and fix any remaining
problems as they're discovered later.  It's better to aim for
correctness and fail in our first attempt than to give up without

IMO, this is a bug, pure and simple.  I think we can do better than
"it's too hard, let's just punt on this".  We are implementors of
Scheme, which has lots of details that are hard to get right, yet we
rise to the challenge, do we not?

> Fixing this would also have complexity and performance costs as well.

One extra check per read primitive is hardly enough of a cost to
consider abandoning correctness, IMO.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]