unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: Chris Vine <chris@cvine.freeserve.co.uk>
To: guile-user@gnu.org
Subject: Re: Nonblocking get-bytevector-n bug?
Date: Wed, 9 Dec 2015 00:52:50 +0000	[thread overview]
Message-ID: <20151209005250.174a5d4b@bother.homenet> (raw)
In-Reply-To: <87si3csinm.fsf@elektro.pacujo.net>

On Wed, 09 Dec 2015 00:02:53 +0200
Marko Rauhamaa <marko@pacujo.net> wrote:
> Marko Rauhamaa <marko@pacujo.net>:
> 
> > 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



      reply	other threads:[~2015-12-09  0:52 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-06 20:38 Nonblocking get-bytevector-n bug? Marko Rauhamaa
2015-12-07  9:50 ` Ludovic Courtès
2015-12-07 10:21   ` Taylan Ulrich Bayırlı/Kammer
2015-12-07 10:58     ` Taylan Ulrich Bayırlı/Kammer
2015-12-07 14:42       ` Ludovic Courtès
2015-12-08 10:53         ` tomas
2015-12-07 10:28   ` Marko Rauhamaa
2015-12-07 11:15     ` Marko Rauhamaa
2015-12-07 12:44 ` Amirouche Boubekki
2015-12-07 12:52   ` Marko Rauhamaa
2015-12-08 15:39 ` Mark H Weaver
2015-12-08 17:34   ` Marko Rauhamaa
2015-12-08 19:28     ` Chris Vine
2015-12-08 21:51       ` Marko Rauhamaa
2015-12-08 22:02         ` Marko Rauhamaa
2015-12-09  0:52           ` Chris Vine [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20151209005250.174a5d4b@bother.homenet \
    --to=chris@cvine.freeserve.co.uk \
    --cc=guile-user@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).