emacs-bug-tracker
[Top][All Lists]
Advanced

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

[debbugs-tracker] bug#12216: closed (peek-char incorrectly *CONSUMES* eo


From: GNU bug Tracking System
Subject: [debbugs-tracker] bug#12216: closed (peek-char incorrectly *CONSUMES* eof)
Date: Sun, 17 Mar 2013 23:50:02 +0000

Your message dated Sun, 17 Mar 2013 19:47:35 -0400
with message-id <address@hidden>
and subject line Re: Problems with Guile's number printer
has caused the debbugs.gnu.org bug report #12216,
regarding peek-char incorrectly *CONSUMES* eof
to be marked as done.

(If you believe you have received this mail in error, please contact
address@hidden)


-- 
12216: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=12216
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- Subject: peek-char incorrectly *CONSUMES* eof Date: Thu, 16 Aug 2012 21:53:23 -0400 (EDT)
All:

Guile's peek-char has a bug; it incorrectly *consumes* eof instead of just 
reporting it.

According to R5RS, "The value returned by a call to peek-char is the same as 
the value that would have been returned by a call to read-char with the same 
port. The only difference is that the very next call to read-char or peek-char 
on that port will return the value returned by the preceding call to peek-char."

However, if the value returned is #eof, guile does *not* meet the spec; you 
*can* get two successive peek-chars with different results.

This doesn't matter for files, but it *does* matter for interactive use.  It 
means that successive peek-char calls will actually *READ* characters, and they 
can even different in results.  Which means that code that does several 
peek-chars can act oddly when someone tries to end it with control-D.

We've confirmed this bug is true for guile 2.0, 1.8, and 1.6.

You can confirm this by placing this in "bug-demo":
===================
(write (peek-char))
(write (peek-char))
======================

Then run "guile bug-demo".  Press control-D, then newline.  You can see that 
two successive calls to peek-char are reporting different results (eof, then 
newline), which is NEVER supposed to happen!

I just had to write some code to work around this, but it'd be nice for this to 
work "correctly" in the future for interactive use.  (This was code for the 
"readable" project, http://readable.sourceforge.net, where we do a lot with 
guile.)

Thanks for your time... and thanks for guile!

--- David A. Wheeler



--- End Message ---
--- Begin Message --- Subject: Re: Problems with Guile's number printer Date: Sun, 17 Mar 2013 19:47:35 -0400 User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)
I've pushed 1ea37620c2c1794f7685b312d2530676a078ada7 to stable-2.0,
which fixes our number printer.  Closing this bug.

   Thanks,
     Mark


--- End Message ---

reply via email to

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