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: Wed, 9 Dec 2015 00:52:50 +0000 Message-ID: <20151209005250.174a5d4b@bother.homenet> References: <87h9jvuxb3.fsf@elektro.pacujo.net> <87k2opymoc.fsf@netris.org> <87poygu9n4.fsf@elektro.pacujo.net> <20151208192807.384d4347@bother.homenet> <8737vctxqv.fsf@elektro.pacujo.net> <87si3csinm.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 1449622475 3612 80.91.229.3 (9 Dec 2015 00:54:35 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 9 Dec 2015 00:54:35 +0000 (UTC) To: guile-user@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Wed Dec 09 01:54:26 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 1a6T1W-0007NW-3B for guile-user@m.gmane.org; Wed, 09 Dec 2015 01:54:26 +0100 Original-Received: from localhost ([::1]:34062 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a6T1U-0005b3-Tx for guile-user@m.gmane.org; Tue, 08 Dec 2015 19:54:24 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36235) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a6T1L-0005au-Hy for guile-user@gnu.org; Tue, 08 Dec 2015 19:54:16 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a6T1H-0004mr-H1 for guile-user@gnu.org; Tue, 08 Dec 2015 19:54:15 -0500 Original-Received: from smtpout5.wanadoo.co.uk ([80.12.242.80]:53186 helo=smtpout.wanadoo.co.uk) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a6T1H-0004md-A4 for guile-user@gnu.org; Tue, 08 Dec 2015 19:54:11 -0500 Original-Received: from bother.homenet ([95.146.111.174]) by mwinf5d66 with ME id rCu81r00B3lopsX03Cu8hp; Wed, 09 Dec 2015 01:54:09 +0100 X-ME-Helo: bother.homenet X-ME-Date: Wed, 09 Dec 2015 01:54:09 +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 DBB481219F0 for ; Wed, 9 Dec 2015 00:52:50 +0000 (GMT) In-Reply-To: <87si3csinm.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.80 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:12233 Archived-At: On Wed, 09 Dec 2015 00:02:53 +0200 Marko Rauhamaa wrote: > Marko Rauhamaa : > > > It seems to me whoever wrote the spec wasn't thinking of nonblocking > > ports at all. Are nonblocking ports recognized by RnRS? > > Took a quick glance at the R6RS spec. It would appear nonblocking > ports are *not* mentioned or thought of in it. > > Thus, *any* nonblocking behavior would be an extension to R6RS, and > Guile can do whatever it wishes. That depends on what you (and other posters) mean. Non-blocking in the O_NONBLOCK POSIX sense is not recognised, probably because that kind of non-blocking does not often make sense in the case of buffered input. Partial satisfaction of a read request, in the mode of POSIX read() on a blocking file descriptor, is recognised to the extent that R6RS get-bytevector-some does something similar to read() for R6RS ports. If you are using select then it is the second of those which is important - you know something is available, but not how much. What is lacking for this is something like a get-bytevector-some! procedure. If you are using guile's POSIX wrapper of fcntl on a scheme port I am not sure what it does. It would be consisent with POSIX's fread() if it threw a EAGAIN exception if nothing is available. As you say, because such ports are not recognised by RnRS they can do what they want. Chris