From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andy Wingo Newsgroups: gmane.lisp.guile.bugs Subject: bug#12216: peek-char incorrectly *CONSUMES* eof Date: Wed, 13 Mar 2013 19:22:41 +0100 Message-ID: <87sj3zdury.fsf@pobox.com> References: <87sj49vld2.fsf@pobox.com> <87ip52ew09.fsf@pobox.com> <87ehfjimug.fsf@pobox.com> <87r4jjfjya.fsf@pobox.com> <87r4jj188o.fsf@tines.lan> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1363199003 29085 80.91.229.3 (13 Mar 2013 18:23:23 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 13 Mar 2013 18:23:23 +0000 (UTC) Cc: dwheeler@dwheeler.com, almkglor , 12216 <12216@debbugs.gnu.org> To: Mark H Weaver Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Wed Mar 13 19:23:44 2013 Return-path: Envelope-to: guile-bugs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UFqKj-0007Bq-7N for guile-bugs@m.gmane.org; Wed, 13 Mar 2013 19:23:25 +0100 Original-Received: from localhost ([::1]:33254 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UFqKM-00064J-LQ for guile-bugs@m.gmane.org; Wed, 13 Mar 2013 14:23:02 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:40280) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UFqKH-00063x-6Z for bug-guile@gnu.org; Wed, 13 Mar 2013 14:23:00 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UFqKF-00008g-GN for bug-guile@gnu.org; Wed, 13 Mar 2013 14:22:57 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:47663) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UFqKF-00008c-AF for bug-guile@gnu.org; Wed, 13 Mar 2013 14:22:55 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1UFqLJ-0006TU-TK for bug-guile@gnu.org; Wed, 13 Mar 2013 14:24:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Andy Wingo Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-guile@gnu.org Resent-Date: Wed, 13 Mar 2013 18:24:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 12216 X-GNU-PR-Package: guile X-GNU-PR-Keywords: Original-Received: via spool by 12216-submit@debbugs.gnu.org id=B12216.136319903524872 (code B ref 12216); Wed, 13 Mar 2013 18:24:01 +0000 Original-Received: (at 12216) by debbugs.gnu.org; 13 Mar 2013 18:23:55 +0000 Original-Received: from localhost ([127.0.0.1]:51772 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UFqLD-0006T6-7G for submit@debbugs.gnu.org; Wed, 13 Mar 2013 14:23:55 -0400 Original-Received: from a-pb-sasl-quonix.pobox.com ([208.72.237.25]:49160 helo=sasl.smtp.pobox.com) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UFqLA-0006Sy-Bj for 12216@debbugs.gnu.org; Wed, 13 Mar 2013 14:23:53 -0400 Original-Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-quonix.pobox.com (Postfix) with ESMTP id 27A4DAEE6; Wed, 13 Mar 2013 14:22:45 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=sasl; bh=aMLIeDMFW2WWnI44ULYmEHOnnTk=; b=m0nFw6 hEKrGwnKITfrEDENa3b5NlN0bXLIQG4DtCb7xFsIHv9XN+a3GMwWIOdqwKU2mTJI gSadJggvXkjqZ0J8Y3qDNe2uVk0rBdSINqlKFQNDd9UHcWL1w7tbP5Xxk7vqM4F5 XzmS4OnfnAhO1NsNJ2f+3eB5vAQTnfv+4NvaM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; q=dns; s=sasl; b=xmUQUjxXMZrC2jCrQUpzdPG4X4B7k+Kq 0kanF4b3gTuXvCJ/BdFfjApKLDliil9Mb5RjaI9wpCxrY+sBmzZS9OZ+YBXbueVa TG7X2ZFql9LsaHWgVw2IvBc+l+eJrMs9tkkRBZOfR8BeyNiiq+MEIDRw4DuNIzzF k8khIYSCs10= Original-Received: from a-pb-sasl-quonix.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-quonix.pobox.com (Postfix) with ESMTP id 1D601AEE5; Wed, 13 Mar 2013 14:22:45 -0400 (EDT) Original-Received: from badger (unknown [88.160.190.192]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by a-pb-sasl-quonix.pobox.com (Postfix) with ESMTPSA id 6CCBEAEE4; Wed, 13 Mar 2013 14:22:44 -0400 (EDT) In-Reply-To: <87r4jj188o.fsf@tines.lan> (Mark H. Weaver's message of "Wed, 13 Mar 2013 14:10:15 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (gnu/linux) X-Pobox-Relay-ID: FFEBCE48-8C0A-11E2-9F1F-0B750E5B5709-02397024!a-pb-sasl-quonix.pobox.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 140.186.70.43 X-BeenThere: bug-guile@gnu.org List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Original-Sender: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.bugs:6955 Archived-At: On Wed 13 Mar 2013 19:10, Mark H Weaver writes: > Andy Wingo writes: > >> On Wed 13 Mar 2013 14:09, "David A. Wheeler" writes: >> >>> Andy Wingo: >>> >>>> So, we are repeating ourselves here :) I agree with you but I can't see >>>> a good way of implementing this. >>> >>> Would the per-port reader options be reasonable place to store the info >>> about EOF? >> >> For your own purposes that would be fine. But it cannot affect >> read-char / peek-char / etc for everyone, because it would have bad >> global effects on performance and correctness. That's why I'm pushing >> back on fixing this in Guile itself. > > 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. Fixing this would also have complexity and performance costs as well. Maybe if it is somehow confined to scm_peek_char and scm_fill_input it could be doable. Andy -- http://wingolog.org/