From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Chris Vine Newsgroups: gmane.lisp.guile.user Subject: Re: Nonblocking get-bytevector-n bug? Date: Tue, 8 Dec 2015 19:28:07 +0000 Message-ID: <20151208192807.384d4347@bother.homenet> References: <87h9jvuxb3.fsf@elektro.pacujo.net> <87k2opymoc.fsf@netris.org> <87poygu9n4.fsf@elektro.pacujo.net> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1449602996 25213 80.91.229.3 (8 Dec 2015 19:29:56 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 8 Dec 2015 19:29:56 +0000 (UTC) To: guile-user@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Tue Dec 08 20:29:48 2015 Return-path: Envelope-to: guile-user@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 1a6NxL-0003eB-Nb for guile-user@m.gmane.org; Tue, 08 Dec 2015 20:29:47 +0100 Original-Received: from localhost ([::1]:33197 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a6NxL-00082g-6l for guile-user@m.gmane.org; Tue, 08 Dec 2015 14:29:47 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51327) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a6Nx6-0007zF-7j for guile-user@gnu.org; Tue, 08 Dec 2015 14:29:33 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a6Nx2-0006DY-Lx for guile-user@gnu.org; Tue, 08 Dec 2015 14:29:32 -0500 Original-Received: from smtpout1.wanadoo.co.uk ([80.12.242.29]:60058 helo=smtpout.wanadoo.co.uk) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a6Nx2-0006CP-Eq for guile-user@gnu.org; Tue, 08 Dec 2015 14:29:28 -0500 Original-Received: from bother.homenet ([95.146.111.174]) by mwinf5d01 with ME id r7VQ1r00J3lopsX037VQWc; Tue, 08 Dec 2015 20:29:26 +0100 X-ME-Helo: bother.homenet X-ME-Date: Tue, 08 Dec 2015 20:29:26 +0100 X-ME-IP: 95.146.111.174 Original-Received: from bother.homenet (localhost [127.0.0.1]) by bother.homenet (Postfix) with ESMTP id 180C41219E2 for ; Tue, 8 Dec 2015 19:28:07 +0000 (GMT) In-Reply-To: <87poygu9n4.fsf@elektro.pacujo.net> X-Mailer: Claws Mail 3.13.0 (GTK+ 2.24.28; i686-pc-linux-gnu) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 80.12.242.29 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Original-Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.user:12230 Archived-At: On Tue, 08 Dec 2015 19:34:39 +0200 Marko Rauhamaa wrote: > Mark H Weaver : > > > While I'm reluctant to guarantee any fixed limit, I can offer this: > > the returned bytevector will always be of a manageable size, > > > > [...] > > > > Would this work for you? > > It suits my immediate needs, thank you. > > However, I think the whole slew of bytevector I/O could take a more > relaxed reading of the RnRS spec, which probably was simply worded > carelessly. I think better non-blocking RnRS input procedures would be advantageous for the reasons you have given, but R6RS and R7RS seem to me to be clear on any reasonable reading: apart from get-bytevector-some they require blocking behaviour if the request has not been met and end-of-file has not been reached (as do other comparable things, such as fread())[1]. Otherwise, get-bytevector-some, for all its inadequacies, would not have been necessary. I would be very surprised if it was a result of careless wording. Chris [1] With the caveat that read-bytevector! will not overrun the bytevector if no end argument is provided (the end position is inferred).